forked from PytLab/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·66 lines (57 loc) · 1.17 KB
/
setup
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
#!/usr/bin/env bash
set -e
version()
{
echo "dotfiles 0.1.1"
}
usage()
{
version
echo "Usage: ./setup [--install | --install --offline | --uninstall]"
}
help()
{
usage
echo
echo " install or uninstall all dotfiles. "
echo
echo " --install Install all dotfiles"
echo " --uninstall Uninstall dotfiles"
echo " --version Show the version number"
echo " --install --offline Install all dotfiles offline"
echo
echo " For more information, see https://github.com/PytLab/dotfiles"
echo
}
if [ "$1" = "--debug" ]; then
export DOTFILES_DEUBG=1
shift
fi
[ -n "${DOTFILES_DEUBG}" ] && set -x
case "$1" in
"--version")
version
;;
"--usage")
usage
;;
"--help")
help
;;
"--install")
if [ -n "$2" ] && [ "$2" = "--offline" ]; then
bash ./setup-install --offline
else
bash ./setup-install
fi
;;
"--uninstall")
bash ./setup-uninstall
;;
*)
echo "Unknown parameter: "$1"" >&2
usage >&2
exit 1
;;
esac
unset DOTFILES_DEUBG