是否可以创建在未安装的情况下运行的NPM脚本?(Is it possible to create an NPM script that runs without being installed?)

编程入门 行业动态 更新时间:2024-10-15 10:13:34
是否可以创建在未安装的情况下运行的NPM脚本?(Is it possible to create an NPM script that runs without being installed?)

我和HiFaraz一起编写了一个小脚本,可以轻松地为Atom文本编辑器安装最佳实践包。 该脚本只运行一些apm install ...命令,不需要安装到node_modules(或再次使用)。 我们决定将其添加到NPM中,以便更容易找到并且更容易运行。

有没有办法运行一次并删除一个NPM脚本? 也许添加一个安装后的脚本?

I've made a little script alongside HiFaraz to easily install best-practice packages for the Atom text editor. The script just runs some apm install ... commands, and does not need to be installed to node_modules (or ever used again). We decided to add it to NPM to make it easier to find and slightly easier to run.

Is there a way to run-once and delete an NPM script? Maybe add a post-install script?

最满意答案

在这种情况下,更好的选择是提供应该执行的脚本本身的链接,例如zsh安装 sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 。 所以在你的情况下命令应该是:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/HiFaraz/atom-starter-pack/master/installer.sh)"

In this case, better option to provide a link to the script itself which should be executed, like for example zsh installation sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)". So in your case command should be:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/HiFaraz/atom-starter-pack/master/installer.sh)"

更多推荐

本文发布于:2023-08-04 23:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1423435.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   情况下   NPM   create   runs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!