Closed mbrodala closed 8 years ago
Other user reported issues using "run" and was successful using "system" instead. Maybe it helps.
You mean like in #53? I'll give it a try.
Works flawlessly, thanks for the hint. :-)
This is what I'm using now:
config.trigger.after :up do
# Mount network share after startup
system "if not exist Z: net use /y Z: \\\\192.168.33.10\\webroot"
end
I stumbled on this issue trying to resolve using 'cd' in an inline script.
The executable "cd" Vagrant is trying to trigger
was not found. If you know it is not in the PATH, please
specify its absolute path using the :append_to_path option.
I'm wondering how triggers chooses which shell it uses and, if we could change this, if this might resolve the issue for us Windows users. (All speculative as I've only just started leaning ruby specifically in order to manipulate vagrant and my understanding of how triggers works is extremely shady as I pour through the code.)
To reduce the noise when trying to re-mount an existing share drive (see #27), I'd like to make it conditional. This is what I tried:
This yields the following error:
Sure,
if
is no command (executable) but a builtin. Thus I tried with a sub-process:But this gives me the following error:
Executing
cmd /c "if not exist Z: net use /y Z: \\192.168.33.10\webroot"
within a command prompt works perfectly fine though.Any idea what's wrong here?