npm install subdirectories using gnu parallel

亡梦爱人 提交于 2019-12-23 20:31:07

问题


I am trying to install a set of sub-directories from the parent dir using GNU parallel.

I'd like to run certain commands for all directories.

Installing

ls -d -- */ | grep -v 'node_modules' | parallel "npm i"

Removing node_modules

ls -d -- */ | grep -v 'node_modules' | parallel "rm -rf node_modules"

Create README.md

ls -d -- */ | grep -v 'node_modules' | parallel "touch README.md"

How can I fire the first argument of parallel as a command within each directory passed to parallel?


回答1:


ls -d -- */ | grep -v 'node_modules' | parallel "cd {} && npm i"


来源:https://stackoverflow.com/questions/48967908/npm-install-subdirectories-using-gnu-parallel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!