forked from urbit/volt
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·56 lines (47 loc) · 828 Bytes
/
install.sh
File metadata and controls
executable file
·56 lines (47 loc) · 828 Bytes
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
set -e
usage() {
printf "Usage: %s [-hwxv] URBIT_DESK_DIRECTORY
(-h: show this help)
(-w: flag to watch and live copy code)
(-x: set excludes file, default=ignore_files.txt)
(-v: verbose)
" "${0}" 1>&2;
exit 1;
}
if [ $# -eq 0 ]; then
usage
exit 2
fi
desk='/home/armitage/urbit/syx/volt'
verbose=false
watch=false
excludes=ignore_files.txt
while getopts 'wxv:?h' opt;
do
case "${opt}" in
w) watch=true ;;
x) excludes="${OPTARG}" ;;
v) verbose=true ;;
h|?) usage ;;
esac
done
shift $((OPTIND-1))
if $verbose ; then
set -x
fi
desk="$1"
sync_files () {
rsync -r --exclude-from="${excludes}" ./urbit/* "${desk}"/
}
if $watch ; then
echo "Watching for changes to copy to ${desk}..."
while true
do
sleep 0.8
sync_files
done
else
sync_files
echo "Installed."
fi