在一個的NodeJS腳本我有以下的代碼,這使得呼叫同步,並返回從shell腳本我打電話的標準輸出: var sh = require('shelljs');
... some code
var output = sh.exec('./someshellscript.sh', {silent:true}).stdout;
console.log(output);
... some more
我想寫一個npm腳本來執行ssh shell命令。目前它正在通過執行osascript命令來打開終端窗口並運行該命令。 我想改變它來執行當前終端的命令。該腳本包括shelljs和executive。當我使用executive時,腳本沒有發生任何事情。隨着shelljs我得到: Pseudo-terminal will not be allocated because stdin is not a