Files
music_tagmove/music_tagmove

68 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
source bashcols
defcol orange 202
if [[ -f $HOME/.config/music_tagmove/config ]]; then
source "$HOME/.config/music_tagmove/config"
fi
if [[ -n $MUSIC_TAGMOVE_DEVELOPER ]]; then
scr_dir=$(dirname "$0")
source "$scr_dir/music_tagmove_lib"
else
source "/usr/lib/music_tagmove_lib"
fi
SPLIT='NO'
while true; do
case "$1" in
'-n'|'--dry-run')
DRY_RUN=1
shift
;;
'-s'|'--split')
SPLIT='YES'
shift
;;
'-y'|'--yes')
YES=1
shift
;;
*)
break
;;
esac
done
source_dir="$1"
dest_root="$2"
printf "======= MUSIC TAGMOVE =======\n> Source dir: %s\n> Dest root: %s\n> Split: %s\n\n" \
"$source_dir" "$dest_root" "$SPLIT"
if [[ -z $YES ]]; then
if [[ -z $DRY_RUN ]]; then
orange printf "REAL RUN - FS WILL BE MODIFIED. CONTINUE? [y/n] "
read -r user_choice
if ! [[ $user_choice =~ ^[yY] ]]; then
exit 0
fi
fi
fi
if [[ $SPLIT == YES ]]; then
cuesplit_all
fi
tagmove
cyan echo -e "\n------- EXECUTION COMPLETE -------\n"
if print_error_stack; then
exit 1
else
exit 0
fi