forked from honestbleeps/Reddit-Enhancement-Suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakelinks.sh
executable file
·61 lines (52 loc) · 1.13 KB
/
makelinks.sh
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
#!/bin/bash
libfiles=("lib/"*)
corefiles=("lib/core/"*)
modulefiles=("lib/modules/"*)
hostsfiles=("lib/modules/hosts/"*)
vendorfiles=("lib/vendor/"*)
files=("${libfiles[@]}" "${corefiles[@]}" "${modulefiles[@]}" "${vendorfiles[@]}" "${hostsfiles[@]}")
paths=("Chrome" "XPI/data" "Opera" "OperaBlink" "RES.safariextension")
for i in "${files[@]}"
do
for j in "${paths[@]}"
do
if [[ -f $i ]]
then
file=$(basename $i)
dir=$(dirname $i)
if [[ $dir == "lib/core" ]]
then
dest="./$j/core/"
elif [[ $dir == "lib/modules" ]]
then
dest="./$j/modules/"
elif [[ $dir == "lib/modules/hosts" ]]
then
dest="./$j/modules/hosts/"
elif [[ $dir == "lib/vendor" ]]
then
dest="./$j/vendor/"
else
dest="./$j/"
fi
echo "Re-linking:" $dest$file
if [[ -f $dest$file ]]
then
rm $dest$file
fi
if [[ $1 != "clean" ]]
then
mkdir -p $dest
ln ./$i $dest
fi
fi
done
done
if [[ -f "OperaBlink/browsersupport-chrome.js" ]]
then
rm "OperaBlink/browsersupport-chrome.js"
fi
if [[ $1 != "clean" ]]
then
ln "Chrome/browsersupport-chrome.js" "OperaBlink/browsersupport-chrome.js"
fi