-
-
Save chernjie/46983c4bc7c07b77014a5ae60065ca1a to your computer and use it in GitHub Desktop.
Revisions
-
chernjie revised this gist
Feb 7, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ for-each-args () { for-each-package() { for i in $(git ls-files --recurse-submodules | grep package.json | xargs -n1 dirname) do cd $i > /dev/null npm $@ & -
chernjie revised this gist
Nov 13, 2019 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,18 @@ #!/usr/bin/env bash # Like `npm`, but executes the command in nested sub-directories within # your current git repository # # @author CJ <lim@chernjie.com> # Example: # # $ npmr ls lodash # List installed packages in nested node packages # # $ npmr i # install node modules recursively for-each-args () { local _command=$1 shift @@ -13,6 +25,7 @@ for-each-args () { } for-each-package() { for i in $(git ls-files | grep package.json | xargs -n1 dirname) do cd $i > /dev/null @@ -29,4 +42,4 @@ case $1 in *) for-each-package $@ ;; esac -
chernjie revised this gist
Nov 13, 2019 . 2 changed files with 32 additions and 35 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,35 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/usr/bin/env bash for-each-args () { local _command=$1 shift for i in $@ do npm $_command $i & done wait } for-each-package() { for i in $(git ls-files | grep package.json | xargs -n1 dirname) do cd $i > /dev/null npm $@ & cd - > /dev/null done wait } case $1 in info) for-each-args $@ ;; *) for-each-package $@ ;; esac -
chernjie revised this gist
Nov 12, 2019 . 2 changed files with 35 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/usr/bin/env bash npm-install () { for i in $(git ls-files | grep package.json | xargs -n1 dirname) do cd $i > /dev/null npm install $@ & cd - > /dev/null done wait } npm-ls () { for i in $(git ls-files | grep package.json | xargs -n1 dirname) do cd $i > /dev/null npm list $@ & cd - > /dev/null done wait for i in $@ do npm info $i & done wait } case $1 in i|install|add) shift; npm-install $@;; ls|la|ll|list) shift; npm-ls $@;; esac This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +0,0 @@ -
chernjie revised this gist
Aug 14, 2019 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env bash for i in $(git ls-files | grep package.json | xargs -n1 dirname) do cd $i > /dev/null npm ls $@ & cd - > /dev/null done wait for i in $@ do npm info $i & done wait -
chernjie created this gist
Sep 9, 2013 .There are no files selected for viewing