-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·47 lines (41 loc) · 845 Bytes
/
install.sh
File metadata and controls
executable file
·47 lines (41 loc) · 845 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
#!/bin/bash
cmd=$(basename "$0");
simulate=0;
while getopts "n" options; do
case $options in
n) simulate=1 ;;
*) echo "usage: $cmd [-n]"; exit 1 ;;
esac
done
mkdir -p "$HOME/bin"
for f in bin/*; do
g="$HOME"/bin/$(basename $f);
echo "ln $f $g"
if [[ "$simulate" == 1 ]]; then
continue
fi
rm -f "$g"
ln "$f" "$g"
done
files=$(shopt -s nullglob dotglob; echo LaunchAgents/*)
if (( ${#files} )); then
mkdir -p "$HOME/Library/LaunchAgents"
for f in LaunchAgents/*; do
g="$HOME"/Library/LaunchAgents/$(basename $f);
echo "ln $f $g"
if [[ "$simulate" == 1 ]]; then
continue
fi
rm -f "$g"
ln "$f" "$g"
done
fi
for f in dot.*; do
g="$HOME/${f/dot/}"
echo "ln $f $g"
if [[ "$simulate" == 1 ]]; then
continue
fi
rm -f "$g"
ln "$f" "$g"
done