-
Notifications
You must be signed in to change notification settings - Fork 3
/
release.sh
executable file
·72 lines (57 loc) · 2.87 KB
/
release.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
python update.py $1
# check system and move files to correct location
if [ "$(uname)" == "Darwin" ]; then
echo "Running on macOS"
mkdir -p "$HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1"
mkdir -p "$HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1/template"
if [ ! -d "$HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1" ]; then
echo "Failed to create directory"
exit 1
fi
if [ -f modernpro-coverletter.typ ] && [ -f typst.toml ]; then
cp -r modernpro-coverletter.typ typst.toml "$HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1"
cp -r template/* "$HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1/template"
echo "Successfully copied files to $HOME/Library/Application Support/typst/packages/local/modernpro-coverletter/$1"
else
echo "One or more files do not exist in the current directory."
exit 1
fi
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo "Running on Linux"
mkdir -p "$HOME/.local/share/typst/packages/local/modernpro-coverletter/$1"
mkdir -p "$HOME/.local/share/typst/packages/local/modernpro-coverletter/$1/template"
if [ ! -d "$HOME/.local/share/typst/packages/local/modernpro-coverletter/$1" ]; then
echo "Failed to create directory"
exit 1
fi
if [ -f modernpro-coverletter.typ ] && [ -f typst.toml ]; then
cp -r modernpro-coverletter.typ typst.toml "$HOME/.local/share/typst/packages/local/modernpro-coverletter/$1"
cp -r template/* "$HOME/.local/share/typst/packages/local/modernpro-coverletter/$1/template"
echo "Successfully copied files to $HOME/.local/share/typst/packages/local/modernpro-coverletter/$1"
else
echo "One or more files do not exist in the current directory."
exit 1
fi
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# %APPDATA%
echo "Running on Windows"
mkdir -p "$APPDATA/typst/packages/local/modernpro-coverletter/$1"
mkdir -p "$APPDATA/typst/packages/local/modernpro-coverletter/$1/template"
if [ ! -d "$APPDATA/typst/packages/local/modernpro-coverletter/$1" ]; then
echo "Failed to create directory"
exit 1
fi
if [ -f modernpro-coverletter.typ ] && [ -f typst.toml ]; then
cp -r modernpro-coverletter.typ typst.toml "$APPDATA/typst/packages/local/modernpro-coverletter/$1"
cp -r template/* "$APPDATA/typst/packages/local/modernpro-coverletter/$1/template"
echo "Successfully copied files to $APPDATA/typst/packages/local/modernpro-coverletter/$1"
else
echo "One or more files do not exist in the current directory."
exit 1
fi
fi
git add .
git commit -m "Update version to $1"
git tag -a $1 -m "$1"
git push origin $1