gruntjs - How to workaround "the input device is not a TTY" when using grunt-shell to invoke a script that calls docker run? -


when issuing grunt shell:test, i'm getting warning "the input device not tty" & don't want have use -f:

$ grunt shell:test running "shell:test" (shell) task input device not tty warning: command failed: /bin/sh -c ./run.sh npm test input device not tty  use --force continue.  aborted due warnings. 

here's gruntfile.js command:

shell: {   test: {     command: './run.sh npm test'   } 

here's run.sh:

#!/bin/sh # should use latest available image validate, not latest if [ -f .env ];   run_env_file='--env-file .env' fi docker run $run_env_file -it --rm --user node -v "$pwd":/app -w /app yaktor/node:0.39.0 $@ 

here's relevant package.json scripts command test:

"scripts": {   "test": "mocha --color=true -r spec test/*.test.js && npm run lint" } 

how can grunt make docker happy tty? executing ./run.sh npm test outside of grunt works fine:

$ ./run.sh npm test  > yaktor@0.59.2-pre.0 test /app > mocha --color=true -r spec test/*.test.js && npm run lint   [snip]    105 passing (3s)   > yaktor@0.59.2-pre.0 lint /app > standard --verbose 

remove "-t" docker run command:

docker run $run_env_file -i --rm --user node -v "$pwd":/app -w /app yaktor/node:0.39.0 $@ 

the "-t" tells docker configure tty, won't work if don't have tty , try attach container (default when don't "-d").


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -