mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-11-21 17:46:31 +00:00
Avoid exiting early when executing test for add_line
This commit is contained in:
parent
6cfc69a116
commit
f3d59be36e
7
helpers/default
Normal file → Executable file
7
helpers/default
Normal file → Executable file
@ -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
Block a user