【发布时间】:2016-09-13 23:40:25
【问题描述】:
我正在创建一个 Atom 包并尝试合并一个 ShellJS 命令。我想使用exec() 命令,每次命令都返回null。
shelljs = require 'shelljs/global'
console.log exec('which git').code // returns null
console.log which 'git' // returns the correct path
为什么?
【问题讨论】:
-
我试过
console.log(exec('which git').code);,效果很好。 Shelljs 版本为 0.7.4。也许这个问题已经在 shelljs 中修复了。
标签: node.js atom-editor shelljs