[英]Is there a benefit to having multiple package.json files on the same application?
[英]Copying multiple files in the same directory using a package.json script?
這適用於命令行:
cp target/{sitemap.xml,robots.txt} ../fs-dtest-app/
但是,如果我將命令放在package.json
中的腳本標記中,如下所示:
"scripts": {
"c": "cp target/{sitemap.xml,robots.txt} ../fs-dtest-app/"
},
有時候是這樣的:
ole@mkt:~/Temp/dtest/fs-dtest-md$ cp target/{sitemap.xml,robots.txt} ../fs-dtest-app/
ole@mkt:~/Temp/dtest/fs-dtest-md$ npm run c
> @fireflysemantics/fs-dtest-md@1.0.1 c /home/ole/Temp/dtest/fs-dtest-md
> cp target/{sitemap.xml,robots.txt} ../fs-dtest-app/
cp: cannot stat 'target/{sitemap.xml,robots.txt}': No such file or directory
想法?
npm will use the /bin/sh
Bourne shell implementation rather than the current interactive shell of a user, whatever that may be (or cmd.exe
on MS platforms).
在交互式 zsh shell 中:
% echo $0
zsh
從同一個交互式 shell 運行npm
:
% npm run shell
> so65660483-npm-shell@1.0.0 shell /so/so65660483-npm-shell
> echo $0
sh
cp
在任何情況下都支持復制多個文件而不依賴 shell 通配符:
cp target/sitemap.xml target/robots.txt ../fs-dtest-app/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.