Avoid exiting early when executing test for add_line
This commit is contained in:
parent
6cfc69a116
commit
f3d59be36e
|
@ -377,14 +377,13 @@ run_as () {
|
|||
add_line () {
|
||||
local line="$1"
|
||||
local file="$2"
|
||||
grep "$line" "$file" > /dev/null 2>&1
|
||||
|
||||
# shellcheck disable=2181
|
||||
if [ $? -ne 0 ]; then
|
||||
if grep "$line" "$file" > /dev/null 2>&1; then
|
||||
log "'$line' already in '$file'. Skipping."
|
||||
else
|
||||
log "Adding '$line' to '$file'..."
|
||||
echo "$line" >> "$file"
|
||||
else
|
||||
log "'$line' already in '$file'. Skipping."
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue