瀏覽代碼

CLI: Use `shutil.which` to detect gmake, instead of OS check.

Pete Johanson 5 年之前
父節點
當前提交
6fb048fdaf
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2 5
      lib/python/qmk/commands.py

+ 2 - 5
lib/python/qmk/commands.py

@@ -5,6 +5,7 @@ import os
 import platform
 import subprocess
 import shlex
+import shutil
 
 import qmk.keymap
 
@@ -28,11 +29,7 @@ def create_make_command(keyboard, keymap, target=None):
         A command that can be run to make the specified keyboard and keymap
     """
     make_args = [keyboard, keymap]
-    make_cmd = 'make'
-
-    platform_id = platform.platform().lower()
-    if 'freebsd' in platform_id:
-        make_cmd = 'gmake'
+    make_cmd = 'gmake' if shutil.which('gmake') else 'make'
 
     if target:
         make_args.append(target)