only-if-file-present
This commit is contained in:
parent
a379bfc742
commit
55d6e21a1d
4 changed files with 6 additions and 3 deletions
|
@ -38,7 +38,7 @@ if [ -z "$state_is" ]; then
|
|||
echo "touch $file"
|
||||
else
|
||||
# only bark if the file should exists
|
||||
if [ -f "$__object/parameter/ifexists" ]; then
|
||||
if [ -f "$__object/parameter/only-if-file-present" ]; then
|
||||
exit 0
|
||||
fi
|
||||
printf 'The file "%s" is missing. Please create it before using %s on it.\n' "$file" "${__type##*/}" >&2
|
||||
|
|
|
@ -31,8 +31,9 @@ file
|
|||
If supplied, use this as the destination file.
|
||||
Otherwise the object_id is used.
|
||||
|
||||
ifexists
|
||||
Only apply the line if the file exists.
|
||||
only-if-file-present
|
||||
Only apply the line if the file exists. This can be used to prevent
|
||||
adding the line to a non-existent file.
|
||||
|
||||
line
|
||||
Specifies the line which should be absent or present.
|
||||
|
|
2
cdist/conf/type/__line/parameter/boolean
Normal file
2
cdist/conf/type/__line/parameter/boolean
Normal file
|
@ -0,0 +1,2 @@
|
|||
create
|
||||
only-if-file-present
|
Loading…
Reference in a new issue