Fix for node

This commit is contained in:
Elio Struyf
2021-05-27 22:39:22 +02:00
parent 50e62b2925
commit 6901ae30f5
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -1,5 +1,9 @@
# Change Log
## [1.16.0] - 2020-05-27
- Fix for Node.js v14.16.0
## [1.16.0] - 2020-05-04
- Add all front matter properties as an argument for custom scripts
+1 -1
View File
@@ -9,4 +9,4 @@ declare const acquireVsCodeApi: <T = unknown>() => {
};
const elm = document.querySelector("#app");
render(<ViewPanel />, elm);
render(<ViewPanel />, elm);
+6 -1
View File
@@ -187,7 +187,12 @@ export class ExplorerView implements WebviewViewProvider, Disposable {
if (wsFolders && wsFolders.length > 0) {
const wsPath = wsFolders[0].uri.fsPath;
exec(`${customScript.nodeBin || "node"} ${path.join(wsPath, msg.data.script)} "${wsPath}" "${editor?.document.uri.fsPath}" "${JSON.stringify(article?.data)}"`, (error, stdout) => {
let articleData = `'${JSON.stringify(article?.data)}'`;
if (os.type() === "Windows_NT") {
articleData = `"${JSON.stringify(article?.data).replace(/"/g, `""`)}"`;
}
exec(`${customScript.nodeBin || "node"} ${path.join(wsPath, msg.data.script)} "${wsPath}" "${editor?.document.uri.fsPath}" ${articleData}`, (error, stdout) => {
if (error) {
window.showErrorMessage(`${msg?.data?.title}: ${error.message}`);
return;