wk-j / vscode-save-and-run

Visual Studio Code extension to run commands whenever a file is saved https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run
Apache License 2.0
32 stars 7 forks source link

Default output in terminal. #8

Closed bashfulrobot closed 7 years ago

bashfulrobot commented 7 years ago

I have a super simple config just to test...

"saveAndRun": {
        "commands":[ 
            {
            "match": "snapcraft.yaml$",
            "cmd": "echo 'hello there!'"
            }            
        ]
    }

When I save that file, I get the following output in the terminal:

$ {
>             "match": "\\.txt$",
>             "cmd": "echo 'I am a .txt file ${file}.'"
>         }

I then have to ctrl-c in the terminal to get the prompt.

So:

  1. While it is matching, why is it outputting a portion of your sample config?
  2. As you can see, my config is supposed to just echo a simple string?

Then I tried with this config:

"saveAndRun": {
        "commands":[ 
            {
            "match": "snapcraft.yaml$",
            "cmd": "ls -al ~"
            }            
        ]
    }

And the output is the same default string broken up between multiple terminal lines.echo "echo 'hello there!

Then I edited it back the original and now I am getting:

dkrysak@awslin01:~/Documents/Projects$ "saveAndRun": {
saveAndRun:: command not found
dkrysak@awslin01:~/Documents/Projects$         "commands":[
commands:[: command not found
dkrysak@awslin01:~/Documents/Projects$             {
>             "match": "snapcraft.yaml$",
>             "cmd": "ls -al ~"
>             }
No command 'match:' found, did you mean:
 Command 'match' from package 'mailavenger' (universe)
match:: command not found
cmd:: command not found
dkrysak@awslin01:~/Documents/Projects$         ]
]: command not found
dkrysak@awslin01:~/Documents/Projects$     }

It seems to be super inconsistent.

wk-j commented 7 years ago

Hi @bashfulrobot

If you using Ubuntu you have to install xclip first https://github.com/xavi-/node-copy-paste/issues/56