Created
December 22, 2016 16:25
-
-
Save superhero/679c01721c40c1d8a42b6ee6124cda3e to your computer and use it in GitHub Desktop.
run in root folder of multiple npm packages to publish them all with 1 command
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 characters
#!/bin/bash | |
docker run \ | |
-it \ | |
--rm \ | |
--volume /etc/localtime:/etc/localtime:ro \ | |
--volume `pwd`/.npmrc:/root/.npmrc \ # notice the login credentials that needs to be mounted | |
--volume `pwd`:/app \ | |
--workdir /app \ | |
node /bin/bash -c " | |
for d in */ ; do | |
cd \$d | |
echo "\$d:" | |
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - | |
npm publish | |
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = | |
cd .. | |
done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment