-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.zsh
35 lines (28 loc) · 1.14 KB
/
update.zsh
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
#!/bin/zsh
source ~/.zshrc
echo ${CYAN}"Update JAP 🍜"${NC}
echo ${BLUE}">>>>>>>"${NC}
JAP_FOLDER="$HOME/jap/"
fetch ${JAP_FOLDER} ${JAP_FOLDER}/jap.zsh https://raw.githubusercontent.com/philipstuessel/jap/main/jap.zsh
echo $(mkdir -p ${JAP_FOLDER}config/.jap) ${MAGENTA}"create: .jap folder"${NC}
echo $(mkdir -p ${JAP_FOLDER}tpl/) ${MAGENTA}"create: tpl folder"${NC}
echo $(mkdir -p ${JAP_FOLDER}plugins/packages/) ${MAGENTA}"create: packages folder"${NC}
echo $(mkdir -p ${JAP_FOLDER}config/) ${MAGENTA}"create: config folder"${NC}
touch "$HOME/jap/config/config.json"
touch "$HOME/jap/config/runs.json"
jap_runs="https://raw.githubusercontent.com/philipstuessel/jap/main/config/runs.json"
jap_conig="https://raw.githubusercontent.com/philipstuessel/jap/main/config/config.json"
if ! test -s "$HOME/jap/config/config.json"; then
fetch2 "$HOME/jap/config/" $jap_conig
fi
if ! test -s "$HOME/jap/config/runs.json"; then
fetch2 "$HOME/jap/config/" $jap_runs
fi
updateConfig
source="${JAP_FOLDER}plugins/source.sh"
if [ ! -f "$source" ]; then
touch "$source"
echo ${MAGENTA}"create: source.sh"${NC}
fi
source ~/.zshrc
echo ${GREEN}"Done"${NC}