Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42e13b2

Browse files
committed
feat: 🎸 write vars to STDOUT when no command specified
1 parent1b5a4a5 commit42e13b2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎lib/cli.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const evalTemplate = (template) => {
4141
constevalCommand=(args)=>{
4242
letcommand='';
4343

44-
for(leti=1;i<args.length;i++){
45-
command+=evalTemplate(args[i])+' ';
44+
for(letindex=1;index<args.length;index++){
45+
command+=evalTemplate(args[index])+' ';
4646
}
4747

4848
returncommand;
@@ -59,6 +59,13 @@ const executeRun = (args) => {
5959

6060
constargv=process.argv.slice(2);
6161

62+
if(!argv[0]){
63+
/* eslint-disable no-console, no-process-exit */
64+
console.log(JSON.stringify(vars,null,4));
65+
process.exit(0);
66+
/* eslint-enable */
67+
}
68+
6269
switch(argv[0]){
6370
case':echo':
6471
case'echo:':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp