Skip to content

Commit

Permalink
Add prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeguzis committed Feb 27, 2024
1 parent f938ce9 commit 07bda14
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions utilities/move-mame-roms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ fi

# Move
roms_to_move=()
num_roms=$(cat "${romlist}" | wc -l)
echo "[INFO] This operation will move ${num_roms} roms from ${src} to ${dest}"
read -erp "Proceed? (y/N): " response
if [[ "${response}" != "y" ]]; then
echo "[INFO] Aborting..."
exit 0
fi

for rom in $(cat "${romlist}");
do
echo "Adding rom from list: $rom to $dest"
rom_file=$(find "${src}" -name "${rom}.zip")
echo "Moving rom from list: $rom to $dest"
rom_file=$(find "${src}" -name "${rom}")
if [[ -z "${rom_file}" ]]; then
echo "[ERROR] Could not find rom ${rom}, skipping"
continue
Expand Down

0 comments on commit 07bda14

Please sign in to comment.