feat(sv-utils): add commandExists - #1323
Conversation
|
Install the latest version of pnx https://pkg.svelte.dev/sv/c/69a41db81c033778fd3a83d15a8e77bcc8533657 createOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 69a41db The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
jycouet
left a comment
There was a problem hiding this comment.
I like it a lot.
Should we move commandExists to sv-utils ? And with a nice JSDoc on top?
|
Hooo, and thx for targeting |
I was thinking we can test it internally first, make sure it actually works.
Haha, that was a mistake. I had intended to target |
|
Nahhh, let's put it directly in the right place imo. 😁 |
Can you approve this commit and we can ask @PixelForm to verify?
Are you referring to |
You can try it with
Yes |
commandExistscommandExists
|
on second thought, maybe we dont need the sanitization |
| }); | ||
|
|
||
| it('returns false for a command that does not exist', () => { | ||
| expect(commandExists('definitely-not-a-real-command-xyz-42')).toBe(false); |
There was a problem hiding this comment.
I have a name for my next bin now! thx :)
There was a problem hiding this comment.
Hmmm, is there an equiv like example.com
There was a problem hiding this comment.
I think it's good like this 👌
Closes #
Alternative to #1322
Description
Replaces the existing
execSync('<bin>', ['--version'])with a battle tested solution based on command-exists (src).This should:
--versionexistingChecklist