qmk_cli
qmk_cli copied to clipboard
Fix relative paths if qmk_firmware exists elsewhere
Description
When an existing qmk_firmware directory exists, the following code happens,
https://github.com/qmk/qmk_cli/blob/36c23e3de621105b02e8a345de6bcc72cfcf0598/qmk_cli/script_qmk.py#L83-L86
This changes the current directory, which in turn changes the context for where relative paths resolve. For both setup and clone this can cause clones to the wrong location.
Steps to reproduce:
- Have a valid
qmk_firmwareconfigured, eg the default of/home/<user>/qmk_firmware/ - Change current directory somewhere empty, eg
mkdir /tmp/asdf/ && cd /tmp/asdf/ - Run
qmk setup -H ./ - Note how cli declares it has found a valid directory and prompts to reinstall/continue