Closed matthew-brett closed 1 year ago
You're using bash conditional syntax, which may not be appropriate on Windows.
Dotbot runs the if
block using Python's subprocess
module, which doesn't guarantee that you'll be running in whatever shell you started in. For example, if you're running the install script in Powershell, the if
block will run in the equivalent of cmd.exe
.
One solution may be to use Python to check your paths. Something similar to this may work:
if: python -c "import pathlib, sys; sys.exit(0) if pathlib.Path(r'C:\Windows\System32').is_dir() else sys.exit(1)"
@matthew-brett closing due to inactivity. If this is not resolved, feel free to re-open.
Please forgive me if I misunderstood the syntax, but I have a clause in my install file for Windows installs:
This always skips. Investigating, this version of the
if
clause does not skip:nor does this:
but this does:
On the other hand, if I run this from the Git Bash shell, I get the expected "is true" output:
Is there something specific going on in Git Bash and the conditional clauses here?