use $__object/tempfile in target instead of mktemp, add comments

This commit is contained in:
ander 2021-09-14 22:24:26 +03:00
parent d7fdc8006f
commit 0f6e48dbc6
No known key found for this signature in database
GPG key ID: 0A2971E562D618F3

View file

@ -35,8 +35,11 @@ then
exit 0
fi
# we can't use -i, because it's not posix, so we fly with tempfile and cp
# and we use cp because we want to preserve destination file's attributes
# shellcheck disable=SC2016
echo 'tmp="$( mktemp )"'
echo 'tmp="$__object/tempfile"'
echo "$sed_cmd -f - '$file' > \"\$tmp\" << EOF"