mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
fix: support Windows ARM64 (clangarm64) in install.cmd
Git for Windows on ARM64 uses a `clangarm64` directory instead of `mingw64`. The installer now auto-detects `clangarm64` when `mingw64` is not present, so it works out of the box on ARM64 Windows machines without requiring the user to manually supply the path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e92878b81b
commit
e4c7e10c0e
32
install.cmd
32
install.cmd
|
|
@ -39,13 +39,25 @@ goto :defaultpath
|
|||
rem remove the last slash
|
||||
SET bindir=%bindir:~0,-1%
|
||||
for %%G in ("%bindir%") do set installdir=%%~dpG
|
||||
set PREFIX=%installdir%mingw64
|
||||
if exist "%installdir%mingw64" (
|
||||
set PREFIX=%installdir%mingw64
|
||||
) else if exist "%installdir%clangarm64" (
|
||||
set PREFIX=%installdir%clangarm64
|
||||
) else (
|
||||
set PREFIX=%installdir%mingw64
|
||||
)
|
||||
goto :foundprefix
|
||||
|
||||
:defaultpath
|
||||
:: default for Git for Windows 2.x
|
||||
if exist "%ProgramFiles%\Git" (
|
||||
set PREFIX=%ProgramFiles%\Git\mingw64
|
||||
if exist "%ProgramFiles%\Git\mingw64" (
|
||||
set PREFIX=%ProgramFiles%\Git\mingw64
|
||||
) else if exist "%ProgramFiles%\Git\clangarm64" (
|
||||
set PREFIX=%ProgramFiles%\Git\clangarm64
|
||||
) else (
|
||||
set PREFIX=%ProgramFiles%\Git\mingw64
|
||||
)
|
||||
)
|
||||
|
||||
:foundprefix
|
||||
|
|
@ -55,6 +67,8 @@ IF NOT "%~1"=="" (
|
|||
REM just supplying the git dir is enough...
|
||||
if exist "%~1\mingw64" (
|
||||
set PREFIX=%~1\mingw64
|
||||
) else if exist "%~1\clangarm64" (
|
||||
set PREFIX=%~1\clangarm64
|
||||
) else (
|
||||
echo Using git install path "%~1" as PREFIX, please make sure it's really a
|
||||
echo path to the mingw64 directory...
|
||||
|
|
@ -72,12 +86,14 @@ set GIT_INSTALL_DIR=!GIT_INSTALL_DIR:"=!
|
|||
IF %GIT_INSTALL_DIR:~-1%==\ SET GIT_INSTALL_DIR=%GIT_INSTALL_DIR:~0,-1%
|
||||
|
||||
if not exist "%GIT_INSTALL_DIR%\mingw64" (
|
||||
echo No mingw64 folder found in %GIT_INSTALL_DIR%.
|
||||
echo.
|
||||
echo Please supply a proper "Git for Windows 2.x" install path:
|
||||
echo "install.cmd c:\[git-install-path]"
|
||||
set ERROR=1
|
||||
goto :exit
|
||||
if not exist "%GIT_INSTALL_DIR%\clangarm64" (
|
||||
echo No mingw64 or clangarm64 folder found in %GIT_INSTALL_DIR%.
|
||||
echo.
|
||||
echo Please supply a proper "Git for Windows 2.x" install path:
|
||||
echo "install.cmd c:\[git-install-path]"
|
||||
set ERROR=1
|
||||
goto :exit
|
||||
)
|
||||
)
|
||||
|
||||
echo Installing to %PREFIX%
|
||||
|
|
|
|||
Loading…
Reference in a new issue