shelljs

    3熱度

    1回答

    在一個的NodeJS腳本我有以下的代碼,這使得呼叫同步,並返回從shell腳本我打電話的標準輸出: var sh = require('shelljs'); ... some code var output = sh.exec('./someshellscript.sh', {silent:true}).stdout; console.log(output); ... some more

    2熱度

    1回答

    我想用shelljs在MATLAB執行COMMANDE並完成後發送響應客戶端: var cmd = 'matlab -nojvm -nosplash -nodesktop -noFigureWindows -minimize -r \" senario(); exit; \"'; shell.exec(cmd, function (code, stdout, stderr) {

    0熱度

    1回答

    我正在創建一個基於nodejs的小cli。我需要的是能夠調用一個shell腳本,這是我npm模塊的一部分(即推送到npm註冊表)。 我在看shelljs,我發現它可以從文件系統執行腳本。不過,我正在看像shell.execute(require('./execute.sh'))。 有沒有辦法做到這一點

    3熱度

    1回答

    我想寫一個npm腳本來執行ssh shell命令。目前它正在通過執行osascript命令來打開終端窗口並運行該命令。 我想改變它來執行當前終端的命令。該腳本包括shelljs和executive。當我使用executive時,腳本沒有發生任何事情。隨着shelljs我得到: Pseudo-terminal will not be allocated because stdin is not a