发出时grunt shell:test
,我收到警告“输入设备不是 TTY”并且不想使用-f
:
$ grunt shell:test
Running "shell:test" (shell) task
the input device is not a TTY
Warning: Command failed: /bin/sh -c ./run.sh npm test
the input device is not a TTY
Use --force to continue.
Aborted due to warnings.
这是Gruntfile.js
命令:
shell: {
test: {
command: './run.sh npm test'
}
这是run.sh
:
#!/bin/sh
# should use the latest available image to validate, but not LATEST
if [ -f .env ]; then
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 $@
这是package.json
scripts
与命令相关的test
:
"scripts": {
"test": "mocha --color=true -R spec test/*.test.js && npm run lint"
}
我怎样才能grunt
对docker
TTY 感到满意?./run.sh npm test
在 grunt 之外执行工作正常:
$ ./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