forked from anysphere/priompt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push-to-open-source.sh
executable file
·32 lines (24 loc) · 994 Bytes
/
push-to-open-source.sh
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
#!/usr/bin/env bash
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [[ -n $(git status --porcelain) ]]; then
echo -e "${RED}Your git state is not empty. Aborting the script...${NC}"
exit 1
fi
# make sure we are on main, otherwise print warning
if [[ $(git branch --show-current) != "main" ]]; then
echo "WARNING: You are not on main branch, please switch to main branch before running this script."
exit 1
fi
# copy over the eslintrc.base.json
cp -f "$SCRIPT_DIR"/../../.eslintrc.base.json "$SCRIPT_DIR"/.eslintrc.base.json
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "update the eslintrc.base.json"
fi
# cd to the root everysphere folder
cd "$SCRIPT_DIR"/../../..
git subtree push --prefix=backend/packages/priompt [email protected]:anysphere/priompt main
git subtree split --rejoin --prefix=backend/packages/priompt
echo "NOW REVIEW THE CHANGES AND PUSH TO GITHUB"
echo "Run git push after reviewing git log NOW."