qmk_cli icon indicating copy to clipboard operation
qmk_cli copied to clipboard

Fix relative paths if qmk_firmware exists elsewhere

Open zvecr opened this issue 8 months ago • 0 comments

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:

  1. Have a valid qmk_firmware configured, eg the default of /home/<user>/qmk_firmware/
  2. Change current directory somewhere empty, eg mkdir /tmp/asdf/ && cd /tmp/asdf/
  3. Run qmk setup -H ./
  4. Note how cli declares it has found a valid directory and prompts to reinstall/continue

zvecr avatar May 02 '25 17:05 zvecr