Skip to content
Myr

Avoid unnecessary confirmation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent c3827de · Browse files · 1 file+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:uninstall+4 added-3 removed
28 unmodified lines
29 line_no=130 match=031 while [ 1 ]; do32 line=$(sed -n "$line_no,\$p" "$src" | grep -m1 -nF "$1") || break33 match=133 line_no=$(( $(sed 's/:.*//' <<< "$line") + line_no - 1 ))35 echo " - Line #$line_no: $(sed 's/^[0-9]*://' <<< "$line")"36 confirm " - Remove (y/n) ? "34 content=$(sed 's/^[0-9]*://' <<< "$line")35 match=136 echo " - Line #$line_no: $content"37 [ "$content" = "$1" ] || confirm " - Remove (y/n) ? "38 if [ $? -eq 0 ]; then39 awk -v n=$line_no 'NR == n {next} {print}' "$src" > "$src.bak" &&40 mv "$src.bak" "$src" || break41 echo " - Removed"
29 unmodified lines