Add script to just add the links to music
This commit is contained in:
parent
7d7c7a9e72
commit
d73f56a3d4
32
arch-config/scripts/pieces/create-links.sh
Normal file
32
arch-config/scripts/pieces/create-links.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# change into music raw folder
|
||||
cd "$HOME/MusikRaw"
|
||||
|
||||
# get directories
|
||||
ls -d */ > directories
|
||||
|
||||
while read -r dir; do
|
||||
# change into directory
|
||||
cd "$dir"
|
||||
# create directory in music
|
||||
mkdir -p "$HOME/Musik/$dir"
|
||||
|
||||
# link cover.jpg
|
||||
if [[ -f cover.jpg ]]; then
|
||||
ln -vf "$HOME/MusikRaw/$dir/cover."* "$HOME/Musik/$dir/"
|
||||
fi
|
||||
|
||||
# make symbolic link to music
|
||||
ln -svf "$HOME/MusikRaw/$dir/normalized/"* "$HOME/Musik/$dir/"
|
||||
# go back to music raw
|
||||
cd "$HOME/MusikRaw"
|
||||
done < directories
|
||||
|
||||
# remove directories file
|
||||
rm directories
|
||||
|
||||
echo Finished!
|
||||
|
||||
exit
|
Loading…
Reference in New Issue
Block a user