【问题标题】:shelljs to execute a shell script part of npm moduleshelljs 执行 npm 模块的 shell 脚本部分
【发布时间】:2017-10-26 13:08:14
【问题描述】:

我正在创建一个基于 nodejs 的小 cli。我需要的是能够调用作为我的 npm 模块一部分的 shell 脚本(推送到 npm 注册表)。

我查看了shelljs,发现它可以从文件系统执行脚本。但是,我正在查看类似 shell.execute(require('./execute.sh')) 的内容。

有没有办法做到这一点

【问题讨论】:

    标签: node.js shelljs


    【解决方案1】:

    最终使用 get-installed-path 指向捆绑包中的 shell 脚本的路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-10
      • 2018-03-29
      • 1970-01-01
      • 1970-01-01
      • 2013-10-16
      • 1970-01-01
      相关资源
      最近更新 更多