Describe the bug
When invoking custom actions using Node.js, the arguments passed are mishandled on Windows. Specifically:
- Paths to scripts are not escaped, leading to issues when directory names contain spaces.
- The JSON argument for front matter, when escaped with single quotes, behaves differently between macOS and Windows. On Windows, the argument loses its double quotes when passed, causing
JSON.parse to fail.
- Additionally, the command
node does not recognize globally installed packages, necessitating absolute paths to libraries in scripts.
To Reproduce
Steps to reproduce the behavior:
- Set up a custom action in Node.js.
- Provide a script path that contains spaces.
- Pass a JSON front matter argument enclosed with single quotes.
- Run the custom action on both macOS and Windows.
- Observe that on Windows, the script may fail due to spaces in the directory name and
JSON.parse will throw an error due to the missing double quotes in the JSON argument.
- Also, note the inability to recognize globally installed packages.
Expected behavior
Arguments should be consistently and correctly passed to custom actions across different operating systems. Paths should be escaped to handle spaces, and JSON arguments should retain their original formatting. Also, globally installed Node.js packages should be recognized without the need for absolute paths.
Screenshots
N/A
Desktop (please complete the following information):
- Windows 10 & 11 (x64), MacOs 13.5 (Apple Silicon)
Additional context
I am using version 8.4.0 of the software.
Describe the bug
When invoking custom actions using Node.js, the arguments passed are mishandled on Windows. Specifically:
JSON.parseto fail.nodedoes not recognize globally installed packages, necessitating absolute paths to libraries in scripts.To Reproduce
Steps to reproduce the behavior:
JSON.parsewill throw an error due to the missing double quotes in the JSON argument.Expected behavior
Arguments should be consistently and correctly passed to custom actions across different operating systems. Paths should be escaped to handle spaces, and JSON arguments should retain their original formatting. Also, globally installed Node.js packages should be recognized without the need for absolute paths.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
I am using version 8.4.0 of the software.