chore: fix jq crashing on Windows when using relative paths (#1276)

`jq` crashes when setting a value on a relative file. We workaround the
issue by using `jq` in a pipe instead of passing the file to it as an
argument.

See: https://github.com/stedolan/jq/issues/1155
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-04-10 23:49:46 -04:00 committed by GitHub
parent c418bc6512
commit 85e1bdb650

View File

@ -56,5 +56,5 @@ if [ -z "$ARGV_PROPERTY" ] ||
fi
TEMPORARY_FILE="$ARGV_TEMPORARY_DIRECTORY/$(basename "$ARGV_FILE").TMP"
jq "$ARGV_PROPERTY=\"$ARGV_VALUE\"" "$ARGV_FILE" > "$TEMPORARY_FILE"
cat "$ARGV_FILE" | jq "$ARGV_PROPERTY=\"$ARGV_VALUE\"" > "$TEMPORARY_FILE"
mv "$TEMPORARY_FILE" "$ARGV_FILE"