mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-11-24 05:06:28 +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 () {
|
add_line () {
|
||||||
local line="$1"
|
local line="$1"
|
||||||
local file="$2"
|
local file="$2"
|
||||||
grep "$line" "$file" > /dev/null 2>&1
|
|
||||||
|
|
||||||
# shellcheck disable=2181
|
# 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'..."
|
log "Adding '$line' to '$file'..."
|
||||||
echo "$line" >> "$file"
|
echo "$line" >> "$file"
|
||||||
else
|
|
||||||
log "'$line' already in '$file'. Skipping."
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user