forked from ungleich-public/cdist
#444 Add messaging to __line-type
This commit is contained in:
parent
e5881301ad
commit
7ee56d099f
2 changed files with 11 additions and 2 deletions
|
@ -60,6 +60,7 @@ case "$state_should" in
|
||||||
# Only replace ' with '"'"' and keep \ as they are
|
# Only replace ' with '"'"' and keep \ as they are
|
||||||
line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g")
|
line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g")
|
||||||
printf '%s' "printf '%s\n' '$line_sanitised' >> $file"
|
printf '%s' "printf '%s\n' '$line_sanitised' >> $file"
|
||||||
|
echo "added" >> "$__messages_out"
|
||||||
|
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
|
@ -83,6 +84,7 @@ fi
|
||||||
grep -v $greparg '$regex' '$file' > \$tmpfile || true
|
grep -v $greparg '$regex' '$file' > \$tmpfile || true
|
||||||
mv -f "\$tmpfile" "$file"
|
mv -f "\$tmpfile" "$file"
|
||||||
eof
|
eof
|
||||||
|
echo "removed" >> "$__messages_out"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown state: $state_should" >&2
|
echo "Unknown state: $state_should" >&2
|
||||||
|
|
|
@ -40,6 +40,13 @@ file
|
||||||
If supplied, use this as the destination file.
|
If supplied, use this as the destination file.
|
||||||
Otherwise the object_id is used.
|
Otherwise the object_id is used.
|
||||||
|
|
||||||
|
MESSAGES
|
||||||
|
--------
|
||||||
|
added
|
||||||
|
The line was added.
|
||||||
|
|
||||||
|
removed
|
||||||
|
The line was removed.
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
Loading…
Reference in a new issue