From e0708d805c2af8c9cc37c88267eece421edc1c93 Mon Sep 17 00:00:00 2001 From: DeepChirp <66902050+DeepChirp@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:09:25 +0800 Subject: feat(msys2): add `xmake.cmd` and `xmake.ps1` for better integration with Windows cmd and powershell --- core/src/cli/xmake.sh | 2 ++ scripts/msys/xmake.cmd | 7 +++++++ scripts/msys/xmake.ps1 | 4 ++++ 3 files changed, 13 insertions(+) create mode 100644 scripts/msys/xmake.cmd create mode 100644 scripts/msys/xmake.ps1 diff --git a/core/src/cli/xmake.sh b/core/src/cli/xmake.sh index 531a6e86a..92825e26f 100755 --- a/core/src/cli/xmake.sh +++ b/core/src/cli/xmake.sh @@ -70,6 +70,8 @@ xmake_after_install() { if test_eq "${project_generator}" "gmake"; then print "\t@if test -f ${installdir}/bin/xmake.exe; then rm ${installdir}/bin/xmake.exe; fi" >> "${xmake_sh_makefile}" print "\t@cp ${projectdir}/scripts/msys/xmake.sh ${installdir}/bin/xmake" >> "${xmake_sh_makefile}" + print "\t@cp ${projectdir}/scripts/msys/xmake.cmd ${installdir}/bin/xmake.cmd" >> "${xmake_sh_makefile}" + print "\t@cp ${projectdir}/scripts/msys/xmake.ps1 ${installdir}/bin/xmake.ps1" >> "${xmake_sh_makefile}" print "\t@cp ${buildir}/xmake.exe ${installdir}/share/xmake" >> "${xmake_sh_makefile}" fi } diff --git a/scripts/msys/xmake.cmd b/scripts/msys/xmake.cmd new file mode 100644 index 000000000..6ea05866c --- /dev/null +++ b/scripts/msys/xmake.cmd @@ -0,0 +1,7 @@ +@echo off +setlocal +set BASEDIR=%~dp0 +if exist "%BASEDIR%..\share\xmake\xmake.exe" ( + "%BASEDIR%..\share\xmake\xmake.exe" %* +) +endlocal \ No newline at end of file diff --git a/scripts/msys/xmake.ps1 b/scripts/msys/xmake.ps1 new file mode 100644 index 000000000..2ecd30763 --- /dev/null +++ b/scripts/msys/xmake.ps1 @@ -0,0 +1,4 @@ +$BASEDIR = Split-Path -Parent $MyInvocation.MyCommand.Definition +if (Test-Path "$BASEDIR\..\share\xmake\xmake.exe") { + & "$BASEDIR\..\share\xmake\xmake.exe" @args +} \ No newline at end of file -- cgit v1.3.1