-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos_bb2sp.sh
executable file
·56 lines (41 loc) · 1 KB
/
macos_bb2sp.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
BYTEBASE="Bytebase"
STASHPAD="Stashpad"
BB_FOLDER=~/Library/Application\ Support/Bytebase
SP_FOLDER=~/Library/Application\ Support/Stashpad
REALM="data.realm"
CONFIG="config.json"
if [ ! -d "$SP_FOLDER" ]; then
echo
echo "Please install $STASHPAD before running this script."
exit 1
fi
echo
echo "If you are currently editing or writing to a byte inside $BYTEBASE submit it and then hit enter to continue..."
read ACCEPT
BB_RUNNING=`pgrep $BYTEBASE`
if [ "$BB_RUNNING" != "" ]
then
echo "Stopping $BYTEBASE..."
killall $BYTEBASE
fi
SP_RUNNING=`pgrep $STASHPAD`
if [ "$SP_RUNNING" != "" ]
then
echo "Stopping $STASHPAD..."
killall $STASHPAD
fi
REALM_FILE="$BB_FOLDER/$REALM"
if [ -f "$REALM_FILE" ]; then
echo
echo "Copying realm data file..."
cp -f "$REALM_FILE" "$SP_FOLDER"
fi
CONFIG_FILE="$BB_FOLDER/$CONFIG"
if [ -f "$CONFIG_FILE" ]; then
echo
echo "Copying config file..."
cp -f "$CONFIG_FILE" "$SP_FOLDER"
fi
echo
echo "Complete. You may now open Stashpad"