-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_build.symbolic.sh
More file actions
executable file
·39 lines (32 loc) · 939 Bytes
/
_build.symbolic.sh
File metadata and controls
executable file
·39 lines (32 loc) · 939 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
#!/usr/bin/bash
echo "Export symbolic icons:"
mkdir_and_cp() {
mkdir -p $(dirname "$2") && cp "$1" "$2"
}
function copyIcon {
file=$1
dest=$2
mkdir_and_cp $file "$DIR/symbolic/web/$dest"
mkdir_and_cp $file "$DIR/symbolic/white/$dest"
mkdir_and_cp $file "$DIR/symbolic/black/$dest"
}
echo -e " Copying files"
shopt -s globstar dotglob
for file in ./icons/**/*.svg; do
parent_dir=$(basename $(dirname "$file../"))
dest=$(basename $file)
if [ $parent_dir == "icons" ]; then
copyIcon $file $dest &
else
copyIcon $file "${parent_dir}_$dest" &
fi
# once we hit $THREADS jobs, wait for one to finish
while (( $(jobs -rp | wc -l) >= THREADS )); do
wait -n
done
done
wait
echo -e " Applying colors"
sed -i 's/#ffffff/#ffffff/g' $DIR/symbolic/white/*
sed -i 's/#ffffff/#000000/g' $DIR/symbolic/black/*
sed -i 's/#ffffff/currentColor/g' $DIR/symbolic/web/*