forked from honestbleeps/Reddit-Enhancement-Suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelinks.sh
executable file
·57 lines (48 loc) · 1015 Bytes
/
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
#!/bin/bash
libfiles=("lib/"*)
corefiles=("lib/core/"*)
modulefiles=("lib/modules/"*)
vendorfiles=("lib/vendor/"*)
files=("${libfiles[@]}" "${corefiles[@]}" "${modulefiles[@]}" "${vendorfiles[@]}")
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/vendor" ]
then
dest="./$j/vendor/"
else
dest="./$j/"
fi
echo "Re-linking:" $dest$file
if [ -f $dest$file ]
then
rm $dest$file
fi
if [ "clean" != "$1" ]
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 [ "clean" != "$1" ]
then
ln "Chrome/browsersupport-chrome.js" "OperaBlink/browsersupport-chrome.js"
fi