-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·73 lines (63 loc) · 1.24 KB
/
install
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
73
#!/usr/bin/env bash
source "./lib/variables"
remoteInstall() {
local host=$1
local hostDir=$2
echo "$host" "$hostDir"
if [[ -z $host ]]; then
printf "Missing host\\n"
return
fi
if [[ -z $hostDir ]]; then
printf "Missing hostDir\\n"
return
fi
rsync --stats -r "$configs_dir" "$host:$hostDir"
rsync --stats -r "$target/.config/base16-shell" "$host:$hostDir/.config"
rsync --stats -r "$target/.oh-my-zsh" "$host:$hostDir"
rsync --stats -r "$configs_dir/shared/custom/robbyrussell.zsh-theme" "$host:$hostDir/.oh-my-zsh/themes"
rsync --stats -r "$target/.vim" "$host:$hostDir"
}
remoteHelp() {
cat <<-EOF
Usage: remote [COMMAND]
Commands:
install <host> <hostDir> Copy files to a remote machine using rsync
EOF
}
remoteProcess() {
case "$1" in
"install")
remoteInstall "${@:2}"
;;
"setup")
remoteSetup
;;
*)
printf "Not a valid command\\n\\n"
remoteHelp
;;
esac
}
help() {
cat <<-EOF
Usage: install [COMMAND]
Commands:
remote Setup .files on a remote machine use remote help for more info
EOF
}
process() {
case "$1" in
"remote")
remoteProcess "${@:2}"
;;
"help")
help
;;
*)
printf "Not a valid command\\n\\n"
help
;;
esac
}
process "$@"