This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
fix: Issue fixed for building binary with recompileFromSource #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for #171 and #141.
The command in recompileFromSource passed to cp.spawnSync uses the && operator to chain multiple npm scripts together. However, && is a shell operator for command chaining and conditional execution.
cp.spawnSync expects a single command as the first argument, making it incompatible with the && operator usage. && is interpreted by the shell, not as part of a single command.
To resolve this, there are two options:
Separate npm scripts into individual commands: Execute each npm script separately using cp.spawnSync. This ensures each script is treated as an independent command, eliminating the need for shell operators like &&.
Execute a shell command: Invoke a shell (e.g., sh) and pass the entire chain of npm scripts with && as the argument to cp.spawnSync. However, this introduces a dependency on the shell environment and may lead to platform or shell inconsistencies.
For simplicity and cleanliness, I recommend option 1. It separates npm scripts into individual commands, aligning with cp.spawnSync requirements and improving code manageability.
Please review and let me know if you have any questions or if further adjustments are needed.