Skip to content

Comments

(feat) Search for .exe on windows#21

Open
koppor wants to merge 2 commits intojbangdev:mainfrom
koppor:patch-1
Open

(feat) Search for .exe on windows#21
koppor wants to merge 2 commits intojbangdev:mainfrom
koppor:patch-1

Conversation

@koppor
Copy link

@koppor koppor commented Jul 29, 2025

Fixes #20 in a very naive way.

A better solution would do

  1. jbang.exe found -> store --version output
  2. jbang.cmd found -> store --version output
  3. If one of them found: use it
  4. If both found: use the one with a greater version number

@koppor koppor changed the title Search for .exe on windows (feat) Search for .exe on windows Jul 29, 2025
jbang.js Outdated


const path =
const path = shell.which('jbang') ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe we can't look for jbang first because then it will find that first. shouldn't that stay in place ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what that means... I can't be jbang.sh, because this is different... Do OSses find a directory here, which could cause issues?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it looks up os and environment specific. like looking at PATHEXT on windows.

Meaning it is less deterministic on what binary it will pick; so shell.which('jbang') could give you 'jbang.exe', 'jbang.cmd', or 'jbang.someotherextinPATHEXT' ..and not necessarily in that orhder.

Hence why we in original code check for os first + specific and well known command (i.e. jbang.exe)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I tried to adapt

Copy link
Contributor

@maxandersen maxandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I doing jbang --version is not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support chocolatey's .exe wrapper

2 participants