You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,16 @@ Snippets are also synced from https://github.com/rescript-lang/rescript-sublime.
59
59
60
60
These are taken care of by the binary at [rescript-editor-support](https://github.com/rescript-lang/rescript-editor-support). We just invoke it in `RescriptEditorSupport.ts`.
61
61
62
+
## Binary Invocation
63
+
64
+
We call a few binaries and it's tricky to call them properly cross-platform. Here are some tips:
65
+
66
+
- We try to call the binaries synchronously to avoid races.
67
+
- Make sure you cater to calling a binary and passing e.g. a path with whitespace in it.
68
+
-`execFile` and its sync version do the above for free.
69
+
-`execFile` does not work on windows for batch scripts, which is what Node scripts are wrapped in. Use `exec`. See more [here](https://github.com/rescript-lang/rescript-vscode/blob/8fcc1ab428b8225c97d2c9a5b8e3a782c70d9439/server/src/utils.ts#L110).
70
+
- Thankfully, many of our binaries are native, so we can keep using `execFile` most of the time.
0 commit comments