Make sure symbolic links are moved

This commit is contained in:
Jeremy Soller 2018-05-21 12:33:33 -06:00
parent 6c226051f9
commit 71a4958ade
1 changed files with 20 additions and 6 deletions

View File

@ -6,9 +6,19 @@ APPS=(
org.gnome.Builder
)
SCALES=(
16x16
22x22
24x24
32x32
48x48
64x64
symbolic
)
if [ ! -d "$1" -o ! -d "$2" ]
then
echo "$0 [original] [new]"
echo "$0 [original directory] [new directory]"
exit 1
fi
@ -18,13 +28,17 @@ NEW="$(realpath "$2")"
cd "$ORIGINAL"
for app in "${APPS[@]}"
do
for folder in */apps
for scale in "${SCALES[@]}"
do
file="$folder/$app.svg"
if [ -f "$file" ]
folder="$scale/apps"
if [ -d "$folder" ]
then
mkdir -pv "$NEW/$folder"
mv -v "$file" "$NEW/$file"
file="$folder/$app.svg"
if [ -f "$file" -o -L "$file" ]
then
mkdir -pv "$NEW/$folder"
mv -v "$file" "$NEW/$file"
fi
fi
done
done