Answer the question
In order to leave comments, you need to log in
What is the correct way to use a variable in a command?
for /r "%begindir%" /d %%i in (*) do (
Set "namePath=%%i"
IF EXIST %%i\test.js (
set "namePath=!namePath:\=/!"
set "namePath=!namePath:%begindir%=!"
set "namePath=!namePath:/test=!"
echo !namePath!
run -o "{\"tests\": \"\!namePath\!/**/*_test.js\"}"
)
)
run -o "{\"tests\": \"\!namePath\!/**/*_test.js\"}"
. With the addition of this line, I get !namePath! not the correct path. Without a launch line, echo displays the desired values. I did not understand how to correctly escape the variable here. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question