mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 19:56:37 +00:00
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:
parent
c418bc6512
commit
85e1bdb650
@ -56,5 +56,5 @@ if [ -z "$ARGV_PROPERTY" ] ||
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
TEMPORARY_FILE="$ARGV_TEMPORARY_DIRECTORY/$(basename "$ARGV_FILE").TMP"
|
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"
|
mv "$TEMPORARY_FILE" "$ARGV_FILE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user