Prevent leaving blank lines in config file after cleared keys.

This commit is contained in:
Scruel Tao authored and GitHub committed 2024-02-27 12:40:52 +08:00
1 parent aa8cf76fb1
commit bd3a2b1bb5
1 file changed
+1 -1
+1 -1
View File
@@ -2351,7 +2351,7 @@ _clear_conf() {
_sdkey="$2"
if [ "$_c_c_f" ]; then
_conf_data="$(cat "$_c_c_f")"
echo "$_conf_data" | sed "s/^$_sdkey *=.*$//" >"$_c_c_f"
echo "$_conf_data" | sed "/^$_sdkey *=.*$/d" >"$_c_c_f"
else
_err "config file is empty, can not clear"
fi
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.