From dabe716c201fedf3021d89c5a8564794bda07f2a Mon Sep 17 00:00:00 2001 From: Buk Bukowski Date: Sat, 15 Jun 2024 20:47:41 +0200 Subject: [PATCH] fix(fixture): support running fixtures on mingw64 (#708) Signed-off-by: Bukowa --- .github/fixtures/test-fixtures-locally.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/fixtures/test-fixtures-locally.sh b/.github/fixtures/test-fixtures-locally.sh index 6287ba4667..05a1c1c23c 100755 --- a/.github/fixtures/test-fixtures-locally.sh +++ b/.github/fixtures/test-fixtures-locally.sh @@ -17,6 +17,19 @@ git init # Commit "$FIXTURES_DIR/commit.sh" +# Check if we are running on Windows with MINGW64 and if cygpath is available +if [ -n "$MSYSTEM" ] && [ "$MSYSTEM" = "MINGW64" ]; then + echo "Running inside MINGW64 trying to convert paths to Windows format." + if command -v cygpath > /dev/null 2>&1; then + # Convert the path to Windows format + SCRIPT_DIR=$(cygpath -w "$SCRIPT_DIR") + FIXTURES_DIR=$(cygpath -w "$FIXTURES_DIR") + else + echo "WARNING: cygpath command not found in the PATH. The script may not work correctly on Windows." + exit 1 + fi +fi + # Show results echo -e "\n---Run git-cliff---" cargo run --manifest-path "$SCRIPT_DIR/../../Cargo.toml" -- -vv --config "$FIXTURES_DIR/cliff.toml" "${@:2}"