From 0620c27e1063d1cc3435d9983cfa86b6962f2c77 Mon Sep 17 00:00:00 2001 From: Jon LaBelle Date: Sat, 5 Apr 2025 12:21:32 -0400 Subject: [PATCH 1/3] feat: bun package manager support --- jsprettier/sthelper.py | 5 +---- jsprettier/util.py | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/jsprettier/sthelper.py b/jsprettier/sthelper.py index 1bd1ac55..ca70f1d5 100644 --- a/jsprettier/sthelper.py +++ b/jsprettier/sthelper.py @@ -194,10 +194,7 @@ def make_local_prettier_path(somepath): # # 4. check globally install prettier - prettier_cmd = 'prettier' - if is_windows(): - prettier_cmd = ensure_file_has_ext(prettier_cmd, ".cmd") - return which(prettier_cmd) + return which('prettier') # handle cases when the user specifies a prettier cli path that is # relative to the working file or project: diff --git a/jsprettier/util.py b/jsprettier/util.py index f3de9d73..ac829e32 100644 --- a/jsprettier/util.py +++ b/jsprettier/util.py @@ -305,6 +305,7 @@ def which(executable, path=None): # "python.exe". If it does match, only test that one, otherwise we # have to try others. # hat tip: https://github.com/pydanny/whichcraft/blob/master/whichcraft.py + pathext.append(".bunx") # add bunx extension for bun package manager if any(executable.lower().endswith(ext.lower()) for ext in pathext): executable_files = [executable] else: From 5d8642fb835f4b27e25c8f263c0b7f3cfba1544c Mon Sep 17 00:00:00 2001 From: Jon LaBelle Date: Sat, 5 Apr 2025 12:32:29 -0400 Subject: [PATCH 2/3] fix: E261 at least two spaces before inline comment --- jsprettier/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsprettier/util.py b/jsprettier/util.py index ac829e32..b8beda08 100644 --- a/jsprettier/util.py +++ b/jsprettier/util.py @@ -305,7 +305,7 @@ def which(executable, path=None): # "python.exe". If it does match, only test that one, otherwise we # have to try others. # hat tip: https://github.com/pydanny/whichcraft/blob/master/whichcraft.py - pathext.append(".bunx") # add bunx extension for bun package manager + pathext.append(".bunx") # add bunx extension for bun package manager if any(executable.lower().endswith(ext.lower()) for ext in pathext): executable_files = [executable] else: From 9713c316cc393c80968e40a5d7dd0250f852439f Mon Sep 17 00:00:00 2001 From: Jon LaBelle Date: Sat, 17 May 2025 10:17:45 -0400 Subject: [PATCH 3/3] refactor: bun uses .exe also --- jsprettier/util.py | 1 - 1 file changed, 1 deletion(-) diff --git a/jsprettier/util.py b/jsprettier/util.py index b8beda08..f3de9d73 100644 --- a/jsprettier/util.py +++ b/jsprettier/util.py @@ -305,7 +305,6 @@ def which(executable, path=None): # "python.exe". If it does match, only test that one, otherwise we # have to try others. # hat tip: https://github.com/pydanny/whichcraft/blob/master/whichcraft.py - pathext.append(".bunx") # add bunx extension for bun package manager if any(executable.lower().endswith(ext.lower()) for ext in pathext): executable_files = [executable] else: