Skip to content

Commit 65b66ec

Browse files
committed
Update install script by bitraid
1 parent 1ebb459 commit 65b66ec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

install

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ append_line() {
333333
[ -f "$file" ] && echo >> "$file"
334334
echo "$line" >> "$file"
335335
else
336-
sed -i "${at_lno}a\\$line" "$file"
336+
sed -i.~fzf_bak "${at_lno}a\\"$'\n'"$line" "$file" && rm "$file.~fzf_bak"
337337
fi
338338
echo " + Added"
339339
else
@@ -425,16 +425,16 @@ if [[ $shells =~ fish ]]; then
425425
echo " - Clear"
426426
echo
427427
if [[ $key_bindings -eq 1 && $auto_completion -eq 1 ]]; then
428-
sed -i "\#$fzf_completion#d" "$bind_file"
429-
sed -i "\#$fzf_key_bindings#d" "$bind_file"
428+
sed -i.~fzf_bak "\#$fzf_completion#d" "$bind_file" && rm "$bind_file.~fzf_bak"
429+
sed -i.~fzf_bak "\#$fzf_key_bindings#d" "$bind_file" && rm "$bind_file.~fzf_bak"
430430
append_line $update_config " fzf --fish | source" "$bind_file" "" "$lno_func"
431431
else
432-
sed -i '/fzf --fish \| source/d' "$bind_file"
432+
sed -i.~fzf_bak '/fzf --fish \| source/d' "$bind_file" && rm "$bind_file.~fzf_bak"
433433
if [[ $key_bindings -eq 1 ]]; then
434-
sed -i "\#$fzf_completion#d" "$bind_file"
434+
sed -i.~fzf_bak "\#$fzf_completion#d" "$bind_file" && rm "$bind_file.~fzf_bak"
435435
append_line $update_config " $fzf_key_bindings" "$bind_file" "" "$lno_func"
436436
elif [[ $auto_completion -eq 1 ]]; then
437-
sed -i "\#$fzf_key_bindings#d" "$bind_file"
437+
sed -i.~fzf_bak "\#$fzf_key_bindings#d" "$bind_file" && rm "$bind_file.~fzf_bak"
438438
append_line $update_config " $fzf_completion" "$bind_file" "" "$lno_func"
439439
fi
440440
fi

0 commit comments

Comments
 (0)