forked from sqlpad/sqlpad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.sh
More file actions
executable file
·51 lines (39 loc) · 1.11 KB
/
version.sh
File metadata and controls
executable file
·51 lines (39 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env sh
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ $BRANCH != "master" ]; then
echo 'Branch must be set to master';
exit 1;
fi
# Determine if branch is up-to-date
# If not exit the script
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
if [ $LOCAL = $REMOTE ]; then
echo "Branch up-to-date"
else
echo "Branch out of date"
exit 1;
fi
# Get relevant directories and ensure script is executed from root of directory
SQLPAD_ROOT_DIR=$(pwd)
SQLPAD_CLIENT_DIR=$(pwd)/client
SQLPAD_SERVER_DIR=$(pwd)/server
SCRIPTS_DIR=$(pwd)/scripts
if [ ! -d $SCRIPTS_DIR ] || \
[ ! -d $SQLPAD_CLIENT_DIR ] || \
[ ! -d $SQLPAD_SERVER_DIR ]
then
echo This script must be executed from the sqlpad project directory
exit 1
fi
VERSION=$1
cd $SQLPAD_CLIENT_DIR
npm --no-git-tag-version version $VERSION || exit 1
cd $SQLPAD_SERVER_DIR
npm --no-git-tag-version version $VERSION || exit 1
cd $SQLPAD_ROOT_DIR
npm --no-git-tag-version version $VERSION || exit 1
git commit -a -m "v$VERSION" || exit 1
git tag -a "v$VERSION" -m "v$VERSION" || exit 1
git push origin master
git push origin "v$VERSION"