mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Clear up which files are removed
This commit is contained in:
parent
81953dd571
commit
49936d1ca2
11
plugins/dups
11
plugins/dups
|
@ -22,10 +22,9 @@ tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
|
||||||
|
|
||||||
printf "\
|
printf "\
|
||||||
## This is an overview of all duplicate files found.
|
## This is an overview of all duplicate files found.
|
||||||
## After editiing this file you will be prompted to remove some of them.
|
## Comment out the files you wish to remove. You will be given an option to cancel.
|
||||||
## You can choose between removing all the commented out files, all the uncommented ones or none at all.
|
## Lines with double comments (##) are ignored.
|
||||||
## Lines with double comments (##) are always ignored.
|
## If you choose to remove, you will be given a choice between removing files with force or interactively.\n
|
||||||
## If you choose to remove, you will be given a choice between removing with force or interactively for each file.\n
|
|
||||||
" > "$tmpfile"
|
" > "$tmpfile"
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
|
@ -43,13 +42,11 @@ p' | sed -E 's/^.{32} (.*) d[0-9]*$/\1/' >> "$tmpfile"
|
||||||
|
|
||||||
"$EDITOR" "$tmpfile"
|
"$EDITOR" "$tmpfile"
|
||||||
|
|
||||||
printf "Remove commented files? (yes/no/abort) [default=a]: "
|
printf "Remove commented files? (yes/no) [default=n]: "
|
||||||
read -r commented
|
read -r commented
|
||||||
|
|
||||||
if [ "$commented" = "y" ]; then
|
if [ "$commented" = "y" ]; then
|
||||||
sedcmd="/^(##|[^#]).*/d; /^$/d; s/^# *(.*)$/\1/"
|
sedcmd="/^(##|[^#]).*/d; /^$/d; s/^# *(.*)$/\1/"
|
||||||
elif [ "$commented" = "n" ]; then
|
|
||||||
sedcmd="/^#.*/d; /^$/d; s/^ *(.*)$/\1/"
|
|
||||||
else
|
else
|
||||||
printf "Press any key to exit"
|
printf "Press any key to exit"
|
||||||
read -r _
|
read -r _
|
||||||
|
|
Loading…
Reference in a new issue