Skip to content

Commit 90d506a

Browse files
author
paulkoeckdev
committed
Added batch support
1 parent 21f22e8 commit 90d506a

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"homepage": "https://github.com/simonkoeck/code-execution-engine#readme",
3232
"dependencies": {
33-
"command-exists": "^1.2.9",
3433
"unique-filename": "^1.1.1"
3534
}
3635
}

runners/win32/bat.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
%1

src/executor.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ export default async function execute(
3030
throw Error("Your OS is not supported yet.");
3131
}
3232

33-
// Check if Command Exists
34-
if (!commandExists(language)) {
35-
throw new Error("This language is not installed on the machine");
36-
}
37-
3833
// Write File to temp folder
3934
var temppath: string = uniqueFilename(tmpdir());
4035
if (language == Language.C) temppath += ".c";
36+
else if (language == Language.BATCH) temppath += ".bat";
4137
writeFileSync(temppath, input, { encoding: "utf-8" });
4238

4339
// Command to execute runner

src/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ enum Language {
22
PYTHON3 = "python3",
33
C = "gcc",
44
BASH = "bash",
5+
BATCH = "bat"
56
}
67

78
export default Language;

0 commit comments

Comments
 (0)