【发布时间】:2017-03-25 00:32:56
【问题描述】:
发出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.jsonscripts 和命令test:
"scripts": {
"test": "mocha --color=true -R spec test/*.test.js && npm run lint"
}
我怎样才能让grunt 让docker 对TTY 感到满意?在 grunt 之外执行 ./run.sh npm test 可以正常工作:
$ ./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
【问题讨论】:
标签: docker gruntjs tty grunt-shell