diff --git a/CompileAll.bat b/CompileAll.bat index 12d572174..4ca452d64 100644 --- a/CompileAll.bat +++ b/CompileAll.bat @@ -42,7 +42,7 @@ REM ---------------- :INIT_ENVIRONMENT -call %~dp0InitEnvironment.bat +call "%~dp0InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR echo. diff --git a/CompileJar.bat b/CompileJar.bat index eba842055..6771bc9c7 100644 --- a/CompileJar.bat +++ b/CompileJar.bat @@ -8,7 +8,7 @@ REM ---------------- if "%ALBaseDir%"=="" ( Set Standalone=1 - call "InitEnvironment.bat" + call "%~dp0InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR ) diff --git a/Embarcadero/Alexandria/Update.bat b/Embarcadero/Alexandria/Update.bat index 3f9ddf638..93151e994 100644 --- a/Embarcadero/Alexandria/Update.bat +++ b/Embarcadero/Alexandria/Update.bat @@ -5,7 +5,7 @@ if "%ALBaseDir%"=="" ( cls Set Standalone=1 set ALDelphiVersion=22.0 - call "..\..\InitEnvironment.bat" + call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR ) @@ -53,10 +53,7 @@ xcopy /Q "%EmbSourceDir%\rtl\net" "%ALBaseDir%\Embarcadero\Alexandria\rtl\net" IF ERRORLEVEL 1 goto ERROR echo Patch the locally copied source code -set PREV_DIR=%CD% -CHDIR "%ALBaseDir%" -git apply --ignore-space-change --ignore-whitespace .\Embarcadero\Alexandria\Alexandria.patch -v -CHDIR "%PREV_DIR%" +git -C "%ALBaseDir%" apply --ignore-space-change --ignore-whitespace .\Embarcadero\Alexandria\Alexandria.patch -v echo Remove warnings from the copied files diff --git a/InitEnvironment.bat b/InitEnvironment.bat index 474abcf6e..7dbc4bc51 100644 --- a/InitEnvironment.bat +++ b/InitEnvironment.bat @@ -5,6 +5,7 @@ REM Init ALBaseDir REM ------------ set ALBaseDir=%~dp0 +IF "%ALBaseDir:~-1%"=="\" SET ALBaseDir=%ALBaseDir:~0,-1% if not exist "%ALBaseDir%\Source\Alcinoe.inc" goto ERROR diff --git a/Libraries/ios/DownloadLibraries.bat b/Libraries/ios/DownloadLibraries.bat index 2b12b5b45..c1d004774 100644 --- a/Libraries/ios/DownloadLibraries.bat +++ b/Libraries/ios/DownloadLibraries.bat @@ -7,7 +7,7 @@ REM ---------------- if "%ALBaseDir%"=="" ( Set Standalone=1 - call "..\..\InitEnvironment.bat" + call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR echo. ) diff --git a/Libraries/jar/DownloadLibraries.bat b/Libraries/jar/DownloadLibraries.bat index a2b951d6d..2cb4792e4 100644 --- a/Libraries/jar/DownloadLibraries.bat +++ b/Libraries/jar/DownloadLibraries.bat @@ -7,7 +7,7 @@ REM ---------------- if "%ALBaseDir%"=="" ( Set Standalone=1 - call "..\..\InitEnvironment.bat" + call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR echo. ) diff --git a/Tests/RunTests.bat b/Tests/RunTests.bat index 4edd63f3e..33820c379 100644 --- a/Tests/RunTests.bat +++ b/Tests/RunTests.bat @@ -14,7 +14,7 @@ if "%ALBaseDir%"=="" ( echo. Set Standalone=1 - call "..\InitEnvironment.bat" + call "%~dp0\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR echo. diff --git a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorAndroid.bat b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorAndroid.bat index 6a1b8d5c8..c6cb8eda3 100644 --- a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorAndroid.bat +++ b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorAndroid.bat @@ -9,7 +9,7 @@ REM ---------------- REM Init Environment REM ---------------- -call "..\..\InitEnvironment.bat" +call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR diff --git a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorIOS.bat b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorIOS.bat index 6afb4c1a1..92add7a82 100644 --- a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorIOS.bat +++ b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorIOS.bat @@ -5,7 +5,7 @@ REM ---------------- REM Init Environment REM ---------------- -call "..\..\InitEnvironment.bat" +call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR diff --git a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorOSX.bat b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorOSX.bat index 0be2aa4e0..4a8eee4cf 100644 --- a/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorOSX.bat +++ b/Tools/NativeBridgeFileGenerator/NativeBridgeFileGeneratorOSX.bat @@ -5,7 +5,7 @@ REM ---------------- REM Init Environment REM ---------------- -call "..\..\InitEnvironment.bat" +call "%~dp0\..\..\InitEnvironment.bat" IF ERRORLEVEL 1 goto ERROR