Skip to content

Commit

Permalink
Cheetah wrapper script no longer clobbers target file on error
Browse files Browse the repository at this point in the history
  • Loading branch information
kspangsege committed Sep 26, 2013
1 parent 6ff9ffc commit 9c42b7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tightdb/objc/cheetah.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ source="$1"
target="$2"

if which cheetah >/dev/null 2>&1; then
cheetah fill --stdout "$source" >"$target" || exit 1
temp_dir="$(mktemp -d "/tmp/cheetah.XXXXXXXXXX")" || exit 1
temp_file="$temp_dir/file"
cheetah fill --stdout "$source" >"$temp_file" || exit 1
cat "$temp_file" >"$target" || exit 1
rm "$temp_file" || exit 1
rmdir "$temp_dir" || exit 1
exit 0
fi

Expand Down

0 comments on commit 9c42b7b

Please sign in to comment.