diff --git a/npmimport.sh b/npmimport.sh index 1f896dc..28f6531 100755 --- a/npmimport.sh +++ b/npmimport.sh @@ -1,5 +1,7 @@ #!/bin/bash +#run shell where you run npm install + # Get command line params while getopts ":r:k:" opt; do case $opt in @@ -8,4 +10,17 @@ while getopts ":r:k:" opt; do esac done -find . -type f -not -path '*/\.*' -name '*.tgz' -exec npm publish {} --registry $REPO_URL \; +cd node_modules + +for m in $(ls -d */ | cut -f1 -d'/') +do + if [ ${m:0:1} == "@" ] + then + for s in $(ls -d $m/*) + do + npm publish "$s" --registry $REPO_URL + done + else + npm publish $m --registry $REPO_URL + fi +done