Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix executable node/mjml-cli path checks #27

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

soulseekah
Copy link
Contributor

@soulseekah soulseekah commented Jun 26, 2024

A regression in 00db9a9 broke setups that depended on PATH environment variables to execute the given node and MJML CLI binaries (MJML_NODE_PATH and MJML_CLI_PATH environment configurations).

Various combinations with npx, nvm, pnpm dlx broke.

This commit introduces a more intelligent check using is_executable and all PATH environment prefixes that should guarantee that an executable will still be found. A convenient wrapper has been introduced via MJMLService::isExecutable.

Fixes #26

A regression in 00db9a9 broke setups
that depended on PATH environment variables to execute the given node
and MJML CLI binaries (`MJML_NODE_PATH` and `MJML_CLI_PATH` environment
configurations).

Various combinations with `npx`, `nvm`, `pnpm dlx` broke.

This commit introduces a more intelligent check using `is_executable`
and all PATH environment prefixes that should guarantee that an
executable will still be found. A convenient wrapper has been
introduced via a private `MJMLService::isExecutable` method.

Fixes superbigco#26
@sjelfull
Copy link
Member

sjelfull commented Jul 4, 2024

Thanks @soulseekah, change makes sense to me. I haven't had time to test it personally, but looks good on the tin, so I will merge it in.

@sjelfull sjelfull merged commit f530a51 into superbigco:main Jul 4, 2024
4 of 5 checks passed
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.

Regression in MJML binary usage with npx, nvm
2 participants