From 4422cd30e646f81005c9a2d6d4d9fdc6059581cc Mon Sep 17 00:00:00 2001 From: SquallATF Date: Wed, 12 May 2021 13:09:44 +0800 Subject: [PATCH] Correct linker-wrapper script under Msys2 and Cygwin. Fixes #58 --- .../resources/com/nishtahir/linker-wrapper.bat | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugin/src/main/resources/com/nishtahir/linker-wrapper.bat b/plugin/src/main/resources/com/nishtahir/linker-wrapper.bat index b5b4992..9f042da 100755 --- a/plugin/src/main/resources/com/nishtahir/linker-wrapper.bat +++ b/plugin/src/main/resources/com/nishtahir/linker-wrapper.bat @@ -1 +1,18 @@ +@echo off +if defined SHELL ( + where /q cygpath + if ERRORLEVEL 1 ( + goto WINSHELL + ) + for /f %%i in ('cygpath -w %SHELL%') do ( + if exist "%%i" ( + "%%i" -c 'RUST_ANDROID_GRADLE_CC="$(cygpath -u "${RUST_ANDROID_GRADLE_CC%%.*}")";^ + exec "$(cygpath -u "%~dp0linker-wrapper.sh")" "%*"' + exit !errorlevel! + ) + exit 1 + ) +) +:WINSHELL +@echo on "%RUST_ANDROID_GRADLE_PYTHON_COMMAND%" "%RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY%" %*