__file: implement --state exists

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/feature_files_export
Steven Armstrong 12 years ago
parent 8f525fbc83
commit f769b395c2
  1. 2
      cdist/conf/type/__file/gencode-local
  2. 2
      cdist/conf/type/__file/gencode-remote

@ -27,7 +27,7 @@ exists="$(cat "$__object/explorer/exists")"
[ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do
if [ "$state_should" = "present" ]; then
if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then
if [ -f "$__object/parameter/source" ]; then
source="$(cat "$__object/parameter/source")"
if [ "$source" = "-" ]; then

@ -26,7 +26,7 @@ state_should="$(cat "$__object/parameter/state")"
exists="$(cat "$__object/explorer/exists")"
case "$state_should" in
present)
present|exists)
# No source? Create empty file
if [ ! -f "$__object/parameter/source" ]; then
if [ "$exists" = "no" ]; then

Loading…
Cancel
Save