Skip to content

Commit 9464cae

Browse files
authored
Fix for chatty bat files when path contains spaces (#20916)
I have no idea what causes this issue but unless we code the path passed to `@if exist` then the commands within are echoed. This only happens when the path contains spaces, and only for the to commands within the `@if exist`. The endless mystery of cmd.exe. Fixes: #20913
1 parent e43f056 commit 9464cae

28 files changed

+34
-26
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ jobs:
828828
# windows and mac do not have separate build and test jobs, as they only run
829829
# a limited set of tests; it is simpler and faster to do it all in one job.
830830
test-windows:
831+
working_directory: "~/path with spaces"
831832
executor:
832833
name: win/vs2019
833834
shell: bash.exe -eo pipefail

bootstrap.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

em++.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

em-config.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

emar.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

embuilder.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

emcc.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

emcmake.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

emconfigure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

emdump.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
25-
@if exist %~f0 (
25+
@if exist "%~f0" (
2626
set MYDIR=%~dp0
2727
goto FOUND_MYDIR
2828
)

0 commit comments

Comments
 (0)