Skip to content

Instantly share code, notes, and snippets.

@p77u4n
Created April 11, 2021 09:14
Show Gist options
  • Save p77u4n/58eeeff53dd6336856ae6e2309e34fe0 to your computer and use it in GitHub Desktop.
Save p77u4n/58eeeff53dd6336856ae6e2309e34fe0 to your computer and use it in GitHub Desktop.
#!/bin/bash
ROOT_DIR=$1
ABS_PATH_ROOT_DIR=$(realpath $ROOT_DIR)
echo $ABS_PATH_ROOT_DIR
if [ ! -d $ABS_PATH_ROOT_DIR ]
then
echo "Please input directory"
exit 0
fi
for dir in ${ABS_PATH_ROOT_DIR}/*
do
echo "Handle Project ${dir}"
if [ -d $dir ]
then
cd $dir
npm publish --registry http://localhost:4873
if [ "$?" -eq "0" ]
then
cd ..
else
echo "Cannot publish ${dir}"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment