From 2aa32bafad60072180d0f9b784590db47c1d797f Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 26 Dec 2018 21:58:03 +0100 Subject: [PATCH] Change variable expansion in build scripts Currently the variable expansion sometimes doesn't work when done over two variables. Inlining the ~dp0 call along with \..\..\ seems to work. Testing leads me to believe that the Windows command prompt caches things in a weird way. --- build_scripts/win/build.cmd | 3 +-- build_scripts/win/deploy.cmd | 3 +-- build_scripts/win/package.cmd | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/build_scripts/win/build.cmd b/build_scripts/win/build.cmd index c88a9f3..1118d41 100644 --- a/build_scripts/win/build.cmd +++ b/build_scripts/win/build.cmd @@ -17,9 +17,8 @@ IF NOT DEFINED project_dir ( REM Arg 0 (called %0) is the full path to the file. REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/call#batch-parameters REM As per above link, %~dp0 expands the zeroth arg to a drive letter and path only. - SET folder_path=%~dp0 REM Project dir is up two dirs from the file. - SET project_dir=%folder_path%\..\..\ + SET project_dir=%~dp0\..\..\ ) REM Change dir to the project dir, otherwise qmake doesn't know where it is. diff --git a/build_scripts/win/deploy.cmd b/build_scripts/win/deploy.cmd index 91fc32a..f19f1b9 100644 --- a/build_scripts/win/deploy.cmd +++ b/build_scripts/win/deploy.cmd @@ -19,9 +19,8 @@ IF NOT DEFINED project_dir ( REM Arg 0 (called %0) is the full path to the file. REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/call#batch-parameters REM As per above link, %~dp0 expands the zeroth arg to a drive letter and path only. - SET folder_path=%~dp0 REM Project dir is up two dirs from the file. - SET project_dir=%folder_path%\..\..\ + SET project_dir=%~dp0\..\..\ ) ECHO %current_activity%: Testing if all required build environment values are set: diff --git a/build_scripts/win/package.cmd b/build_scripts/win/package.cmd index a1d7320..b7b76ad 100644 --- a/build_scripts/win/package.cmd +++ b/build_scripts/win/package.cmd @@ -19,9 +19,8 @@ IF NOT DEFINED project_dir ( REM Arg 0 (called %0) is the full path to the file. REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/call#batch-parameters REM As per above link, %~dp0 expands the zeroth arg to a drive letter and path only. - SET folder_path=%~dp0 REM Project dir is up two dirs from the file. - SET project_dir=%folder_path%\..\..\ + SET project_dir=%~dp0\..\..\ ) REM ZIP_LOC can't be called 7Z_LOC because of Windows limitations.