diff --git a/compile.bat b/compile.bat index 159dc41..8547586 100644 --- a/compile.bat +++ b/compile.bat @@ -1,14 +1,14 @@ @echo off setlocal EnableDelayedExpansion -set ROOTDIR=%CD% +for %%I in ("%~dp0.") do set "ROOTDIR=%%~fI" echo Compiling BlitzForge Toolchain... -call .\scripts\msbuild_init.bat +call "%ROOTDIR%\scripts\msbuild_init.bat" -cd %ROOTDIR% +cd /d "%ROOTDIR%" -call .\scripts\msbuild_blitzforge.bat +call "%ROOTDIR%\scripts\msbuild_blitzforge.bat" -cd %ROOTDIR% -endlocal \ No newline at end of file +cd /d "%ROOTDIR%" +endlocal diff --git a/publish.bat b/publish.bat index c2d1833..16f269c 100644 --- a/publish.bat +++ b/publish.bat @@ -1,11 +1,11 @@ @echo off setlocal -set ROOTDIR=%CD% +for %%I in ("%~dp0.") do set "ROOTDIR=%%~fI" -call .\compile.bat +call "%ROOTDIR%\compile.bat" -cd %ROOTDIR% +cd /d "%ROOTDIR%" if exist "%ROOTDIR%\release" rmdir /S /Q "%ROOTDIR%\release" @@ -25,7 +25,7 @@ REM Copy the compiled vscode extension if exist "%ROOTDIR%\..\..\extras\vscode-blitz-forge" ( call "%ROOTDIR%\..\..\extras\vscode-blitz-forge\compile.bat" - cd %ROOTDIR% + cd /d "%ROOTDIR%" xcopy /Y "%ROOTDIR%\..\..\extras\vscode-blitz-forge\*.vsix" "%ROOTDIR%\release\" ) @@ -33,4 +33,4 @@ if exist "%ROOTDIR%\..\..\extras\vscode-blitz-forge" ( REM Create a README.txt file echo "BlitzForge is a compiler for an enhanced version of the Blitz3D language. It is a fork of the Blitz3D compiler and adds support for the BlitzForge commands and syntax. You can develop with BlitzForge in Visual Studio Code by installing the .vsix extension. Press Ctrl+Shift+P and search for vsix to install the extension." > "%ROOTDIR%\release\README.txt" -endlocal \ No newline at end of file +endlocal diff --git a/test.bat b/test.bat index e5a7063..8a06c64 100644 --- a/test.bat +++ b/test.bat @@ -1,7 +1,7 @@ @echo off setlocal EnableDelayedExpansion -set ROOTDIR=%CD% +for %%I in ("%~dp0.") do set "ROOTDIR=%%~fI" set BLITZPATH=%ROOTDIR% set FAILED=0 @@ -11,14 +11,14 @@ call :expect_success "host alias compiles NumberTest" -c +q -target host "%SAMPL call :expect_success "native Windows target compiles NumberTest" -c +q -target windows-x86 "%SAMPLE%" call :expect_failure "foreign macOS target is rejected" "Unsupported -target" -c +q -target macos-arm64 "%SAMPLE%" -cd %ROOTDIR%\tests +cd /d "%ROOTDIR%\tests" for /R %%f in (*.bb) do ( "%BLITZPATH%\bin\blitzcc.exe" -t "%%f" || (echo "%%f failed at least one test" && SET FAILED=1) echo. ) -cd %ROOTDIR% +cd /d "%ROOTDIR%" if !FAILED! == 1 ( echo "Tests failed"