Skip to content
Myr

[uninstall] Remove readlink to support relative symlinks of dotfiles

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

Close #2853

authored by Junegunn Choi · committed by Junegunn Choi · parent 885cd8f · Browse files · 1 file+5 added−9 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+5 added−9 removed

  • other:+5 added−9 removed

1 file+5 added−9 removed

modified:uninstall+5 added-9 removed
49 unmodified lines
50 rm -f "$1"51}5253remove_line() {54 src=$(readlink "$1")55 if [ $? -eq 0 ]; then56 echo "Remove from $1 ($src):"57 else58 src=$159 echo "Remove from $1:"54 src=$155 echo "Remove from $1:"60 fi5657 shift58 line_no=159 match=0
9 unmodified lines
69 match=170 echo " - Line #$line_no: $content"71 [ "$content" = "$1" ] || ask " - Remove?"72 if [ $? -eq 0 ]; then73 temp=$(mktemp)78 awk -v n=$line_no 'NR == n {next} {print}' "$src" > "$src.bak" &&79 mv "$src.bak" "$src" || break74 awk -v n=$line_no 'NR == n {next} {print}' "$src" > "$temp" &&75 cat "$temp" > "$src" && rm -f "$temp" || break76 echo " - Removed"77 else78 echo " - Skipped"79 line_no=$(( line_no + 1 ))
34 unmodified lines