Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit e9e6c8c

Browse files
author
Jianghao Lu
committed
Add publish all packages bash script
1 parent a840c8a commit e9e6c8c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tasks/publishall.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
if [[ $(pwd) == *tasks ]]; then
4+
cd ../
5+
fi
6+
cd lib/services
7+
published=""
8+
failed=""
9+
for p in $(ls -d */); do
10+
cd $p
11+
ret=$(npm publish)
12+
if [ ret == 0 ]; then
13+
published="$published, $p"
14+
else
15+
failed="$failed, $p"
16+
fi
17+
cd ..
18+
done
19+
RED='\033[0;31m'
20+
GREEN='\033[0;32m'
21+
NC='\033[0m' # No Color
22+
echo -e "${GREEN}Published packages:${NC} $published"
23+
echo -e "${RED}Failed packages:${NC} $failed"

0 commit comments

Comments
 (0)