Merge pull request #4259 from Mon-ius/master

fix a issue, when profile not end with newline
This commit is contained in:
neil
2022-10-05 14:20:01 +08:00
committed by GitHub

View File

@@ -2257,6 +2257,9 @@ _setopt() {
if [ ! -f "$__conf" ]; then
touch "$__conf"
fi
if [ -n "$(tail -c 1 <"$__conf")" ]; then
echo >>"$__conf"
fi
if grep -n "^$__opt$__sep" "$__conf" >/dev/null; then
_debug3 OK