-
Notifications
You must be signed in to change notification settings - Fork 535
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
Use cross-spawn instead of child_process and introduce _W32 placeholders #2015
Conversation
Also use cross-spawn for calling texdoc. Related to #2010
This change enables us to check that the cwd directory is correct if the outDir is generated at the right place.
@tamuratak while I was adding more tests, I realised that the issue on I finally figured out that the tool
works fine as long as
EDIT: Forget about that, this is far too intrusive and it may cause a lot of issue. I will instead test an other strategy:
|
The replacement function is moved to utils/utils.js. It is used whereever placeholders are used.
The new placeholders %DOC_W32%, %DOC_EXT_W32%, %DIR_W32% %OUTDIR_W32% are normalized so that they use `\\` as the path separator on Windows. Placeholders without the _W32 suffix always use `/` as the path separator. On Unix platforms, placeholders with and without the _W32 suffix have the same value.
See https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#placeholders for the definitions of the new placeholders. |
Related to the tests and discussions in #2010.
It must be extensively tested before merging (paths with
/
,\\
, spaces and also custom recipes using system commands).Close #2010
Edit: Summary of the PR
child_process.spawn
are replaced bycross-spawn.spawn
, which takes care of escaping issues in a cross platform way.%DOC_W32%
,%DOC_EXT_W32%
,%DIR_W32%
,%OUTDIR_W32%
, which are normalized so that they use\\
as the path separator on Windows. Placeholders without the_W32
suffix always use/
as the path separator. On Unix platforms, placeholders with and without the_W32
suffix have the same value.