Skip to content

Commit 0fb8511

Browse files
authored
Fixes #3843
Fixes #3843 by using nodejs fs.copyFileSync to copy pre-built compilers instead of using ninja.exe. Since ninja.exe is classed as trojan by many anti-virus software.
1 parent 32ae22d commit 0fb8511

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

scripts/install.js

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -196,44 +196,11 @@ function install(stdlib) {
196196
});
197197
}
198198

199-
/**
200-
*
201-
* @param {string} sys_extension
202-
*
203-
*/
204-
function createCopyNinja(sys_extension) {
205-
var output = "";
206-
switch (sys_extension) {
207-
case ".win32":
208-
output += `
209-
rule cp
210-
command = cmd /q /c copy $in $out 1>nul
211-
`;
212-
break;
213-
default:
214-
output += `
215-
rule cp
216-
command = cp $in $out
217-
`;
218-
break;
219-
}
220-
output += ["bsc", "bsb", "bsb_helper", "bsppx", "refmt"]
221-
.map(function(x) {
222-
return `build ${x}.exe: cp ${x}${sys_extension}`;
223-
})
224-
.join("\n");
225-
output += "\n";
226-
return output;
227-
}
228-
229199
function copyPrebuiltCompilers() {
230-
var filePath = path.join(lib_dir, "copy.ninja");
231-
fs.writeFileSync(filePath, createCopyNinja(sys_extension), "ascii");
232-
cp.execFileSync(ninja_bin_output, ["-f", "copy.ninja"], {
233-
cwd: lib_dir,
234-
stdio: [0, 1, 2]
200+
["bsc", "bsb", "bsb_helper", "bsppx", "refmt"]
201+
.forEach(function (x) {
202+
fs.copyFileSync(path.join(lib_dir, `${x}${sys_extension}`), path.join((lib_dir), `${x}.exe`));
235203
});
236-
fs.unlinkSync(filePath);
237204
}
238205

239206
/**

0 commit comments

Comments
 (0)