commit 5fb2df9568f785b3a4aa8f732e5a0d9d2655fa6a parent 60355e3febbcc6dd1b6d76436d951b5b9f7c33ed Author: Alex Balgavy <a.balgavy@gmail.com> Date: Wed, 11 Dec 2019 12:43:21 -0500 sync_phone_music: fix result paging Former-commit-id: 24ab277aa26994d4b761be996d4ec6ececacc784 Diffstat:
M | scripts/sync_phone_music | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/sync_phone_music b/scripts/sync_phone_music @@ -32,7 +32,13 @@ MUSIC_DIR="${MUSIC_DIR:-$HOME/Music}" PARAMS="" -less -fR <(do_sync "$MUSIC_DIR"/ "$PHONE_DIR" --dry-run) +# Piping directly didn't work for some reason, less wouldn't page it +outfile=$(mktemp) +trap "rm $outfile" INT TERM EXIT +echo "Calculating differences..." +{ do_sync "$MUSIC_DIR"/ "$PHONE_DIR" --dry-run; } &> "$outfile" +less -fR "$outfile" && rm "$outfile" +trap - INT TERM EXIT read -rp "Execute? [Y/n]" -n 1 -s conf echo