Skip to content

Commit 7042128

Browse files
committed
fix: added bash script
1 parent 284d0a2 commit 7042128

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
yarn install --immutable
4+
5+
if [ $# -ge 1 ] && [ "$1" = "generate_nightly_version" ]; then
6+
VERSION=$(jq -r '.version' package.json)
7+
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
8+
GIT_COMMIT=$(git rev-parse HEAD)
9+
DATE=$(date +%Y%m%d)
10+
NIGHTLY_UNIQUE_NAME="${GIT_COMMIT:0:7}-$DATE"
11+
if [[ "$OSTYPE" == "darwin"* ]]; then
12+
sed -i '' "3s/.*/ \"version\": \"$MAJOR.$MINOR.$PATCH-nightly-$NIGHTLY_UNIQUE_NAME\",/" package.json
13+
else
14+
sed -i "3s/.*/ \"version\": \"$MAJOR.$MINOR.$PATCH-nightly-$NIGHTLY_UNIQUE_NAME\",/" package.json
15+
fi
16+
fi
17+
18+
yarn bob build
19+
20+
npm pack
21+
22+
if [ $# -ge 1 ] && [ "$1" = "generate_nightly_version" ]; then
23+
if [[ "$OSTYPE" == "darwin"* ]]; then
24+
sed -i '' "3s/.*/ \"version\": \"$MAJOR.$MINOR.$PATCH\",/" package.json
25+
else
26+
sed -i "3s/.*/ \"version\": \"$MAJOR.$MINOR.$PATCH\",/" package.json
27+
fi
28+
fi
29+
30+
echo "Done!"

0 commit comments

Comments
 (0)