diff options
| author | Erovia <Erovia@users.noreply.github.com> | 2020-03-29 14:29:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-29 14:29:44 +0200 |
| commit | c89c0841468ad23153a9fc9578d344845df31a88 (patch) | |
| tree | da17997995c2657511b3f4a8eefbdd0b3c3725a2 /bin | |
| parent | 13fff52f6b629e4345e7ea2296b3d100aa9df245 (diff) | |
| download | qmk_firmware-c89c0841468ad23153a9fc9578d344845df31a88.tar.gz qmk_firmware-c89c0841468ad23153a9fc9578d344845df31a88.zip | |
CLI: More MSYS2 fixes (#8577)
* CLI: More MSYS2 fixes
Now I can fully setup and work with qmk_firmware on an MSYS2
installation without any errors or exceptions.
* Apply suggestions from code review
Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com>
* Some improvements
* Remove unnecessary import
* Remove slow, unused code
Getting the version from GIT was slow on both Windows and Docker.
Until we find a better, faster way, this is removed.
* remove unused imports
* Implement @vomindoraan's suggestions
* refine how we pick the shell to use
* Apply @fauxpark's suggestions
fauxpark investigated the topic of shells in MSYS2 a bit and we come to the conclusion that the safest bet was to just use the user's shell.
Anything more just opens up more edge-cases than it solves.
Co-Authored-By: Ryan <fauxpark@gmail.com>
* Use `platform_id` in doctor
This will bring it in line with the new code.
Co-authored-by: skullydazed <skullydazed@users.noreply.github.com>
Co-authored-by: skullY <skullydazed@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/qmk | 12 |
1 files changed, 0 insertions, 12 deletions
| @@ -2,10 +2,8 @@ | |||
| 2 | """CLI wrapper for running QMK commands. | 2 | """CLI wrapper for running QMK commands. |
| 3 | """ | 3 | """ |
| 4 | import os | 4 | import os |
| 5 | import subprocess | ||
| 6 | import sys | 5 | import sys |
| 7 | from importlib.util import find_spec | 6 | from importlib.util import find_spec |
| 8 | from time import strftime | ||
| 9 | 7 | ||
| 10 | # Add the QMK python libs to our path | 8 | # Add the QMK python libs to our path |
| 11 | script_dir = os.path.dirname(os.path.realpath(__file__)) | 9 | script_dir = os.path.dirname(os.path.realpath(__file__)) |
| @@ -35,16 +33,6 @@ with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd: | |||
| 35 | print('Please run `pip3 install -r requirements.txt` to install the python dependencies.') | 33 | print('Please run `pip3 install -r requirements.txt` to install the python dependencies.') |
| 36 | exit(255) | 34 | exit(255) |
| 37 | 35 | ||
| 38 | # Figure out our version | ||
| 39 | # TODO(skullydazed/anyone): Find a method that doesn't involve git. This is slow in docker and on windows. | ||
| 40 | command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags'] | ||
| 41 | result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | ||
| 42 | |||
| 43 | if result.returncode == 0: | ||
| 44 | os.environ['QMK_VERSION'] = result.stdout.strip() | ||
| 45 | else: | ||
| 46 | os.environ['QMK_VERSION'] = 'nogit-' + strftime('%Y-%m-%d-%H:%M:%S') + '-dirty' | ||
| 47 | |||
| 48 | # Setup the CLI | 36 | # Setup the CLI |
| 49 | import milc # noqa | 37 | import milc # noqa |
| 50 | 38 | ||
