Wie umgehen Sie das Problem "das Eingabegerät ist kein TTY" wenn Sie grunt-shell verwenden, um ein Skript aufzurufen, das docker run aufruft?

Beim ausstellen grunt shell:test ich bin immer in der Warnung "das Eingabe-Gerät ist kein TTY" & don ' T wollen, verwenden Sie -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.

Hier ist die Gruntfile.js Befehl:

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

Hier 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 $@

Hier ist der relevante package.json scripts mit Befehl test:

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

Wie bekomme ich grunt zu machen docker glücklich mit TTY? Ausführung ./run.sh npm test außerhalb von grunt gut funktioniert:

$ ./run.sh npm test

> [email protected] test /app
> mocha --color=true -R spec test/*.test.js && npm run lint


[snip]

  105 passing (3s)


> [email protected] lint /app
> standard --verbose

InformationsquelleAutor der Frage Matthew Adams | 2016-11-10

Schreibe einen Kommentar