On Windows, many programs are resilient to this kind of thing, but several are not. For instance, see the output of dir %Qt5_DIR%/lib/cmake in the same workflow: Invalid switch - "install-qt-action".. This happens because dir, like many Windows programs, interprets / as the beginning of a switch or flag, not as part of a directory separator.
You could fix this problem by surrounding paths with double-quotes, like this:
This PR uses the Node standard library
path
module to convert paths into the native format on every platform.This action sets several environment variables that include paths. On Windows, many of these paths include
/
instead of\
, or use some mix of both:Example from: https://github.com/jurplel/install-qt-action/runs/3916210538?check_suite_focus=true#step:7:10
On Windows, many programs are resilient to this kind of thing, but several are not. For instance, see the output of
dir %Qt5_DIR%/lib/cmake
in the same workflow:Invalid switch - "install-qt-action".
. This happens becausedir
, like many Windows programs, interprets/
as the beginning of a switch or flag, not as part of a directory separator.You could fix this problem by surrounding paths with double-quotes, like this:
This change prevents potential issues on Windows by making sure all the environment variables use the correct path separators. You can see the effects on a successful Windows build here: https://github.com/ddalcino/install-qt-action/runs/3969848239?check_suite_focus=true#step:7:1 In this case,
dir
prints properly, and there are no error messages.