I'm trying to do such task:
- Setup git in path environment
- Run bower
I want to do that as single command:
cmd.exe /c "set PATH=%PATH%;c:\git && bower.cmd"
Unfortunately it doesn't work. For some reason the path variable doesn't change.
Does any body know why?
bower.cmd
In a batch file ... any variable changes will not be visible until execution moves to the next line
That's correct as far as %variable% expansion goes in the batch file itself. But the commands are still executed sequentially with immediate effect, so any subsequent command will see the just updated variable. That's easiest to verify if testing with a non-pre-existent environment variable, for exampleset "aaa=zzz" && set aaa
will displayaaa=zzz
at the prompt.