diff --git a/uv/private/pip_compile_test.sh b/uv/private/pip_compile_test.sh index e63d6ae..13c4c31 100644 --- a/uv/private/pip_compile_test.sh +++ b/uv/private/pip_compile_test.sh @@ -8,17 +8,19 @@ REQUIREMENTS_TXT="{{requirements_txt}}" COMPILE_COMMAND="{{compile_command}}" # make a writable copy of incoming requirements -cp "$REQUIREMENTS_TXT" __updated__ +updated_file=$(mktemp) +trap 'rm -f "$updated_file"' EXIT +cp "$REQUIREMENTS_TXT" "$updated_file" {{uv}} pip compile \ --quiet \ --no-cache \ {{args}} \ - --output-file="__updated__" \ + --output-file="$updated_file" \ "$REQUIREMENTS_IN" # check files match -DIFF="$(diff "$REQUIREMENTS_TXT" "__updated__" || true)" +DIFF="$(diff "$REQUIREMENTS_TXT" "$updated_file" || true)" if [ "$DIFF" != "" ] then echo >&2 "FAIL: $REQUIREMENTS_TXT is out-of-date. Run '$COMPILE_COMMAND' to update."