check for existence before (re-)creation

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/1.0
Nico Schottelius 14 years ago
parent e48458f27f
commit 03502567e3
  1. 27
      conf/type/__file/gencode

@ -70,20 +70,23 @@ if [ -f "$__object/parameter/source" ]; then
fi fi
# No source? Create empty file/dir # No source? Create empty file/dir
else else
case "$type" in # Only touch / create if it does not exist
directory) if [ no = "$(cat "$__object/explorer/exists")" ]; then
echo mkdir \"$destination\" case "$type" in
;; directory)
echo mkdir \"$destination\"
;;
file) file)
echo touch \"$destination\" echo touch \"$destination\"
;; ;;
*) *)
echo "Unsupported type: \"$type\"" >&2 echo "Unsupported type: \"$type\"" >&2
exit 1 exit 1
;; ;;
esac esac
fi
fi fi
if [ -f "$__object/parameter/mode" ]; then if [ -f "$__object/parameter/mode" ]; then

Loading…
Cancel
Save