Skip to content

Commit

Permalink
Add logSuccess code execution
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonynmh committed Nov 6, 2023
1 parent 293318f commit 55d2481
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Execution/src/ExecutionController.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const executePython = async (req, res) => {
const pythonProcess = spawn('python', [scriptPath]); // Command to execute the script
const result = await executeScript(scriptPath, pythonProcess, false);

logger.logSuccess("Program executed successfully.");

res.json({ output: result });
} catch (err) {
logger.log(err);
Expand All @@ -69,9 +71,13 @@ const executeJava = async (req, res) => {
const compileProcess = spawn('javac', [javaFilename]);
const compileResult = await executeScript(javaFilename, compileProcess, false);

logger.logSuccess("Program compiled successfully.");

const javaProcess = spawn('java', [javaClassName]);
const result = await executeScript(javaClassName, javaProcess, true);

logger.logSuccess("Program executed successfully.");

res.json({ output: result });
} catch (err) {
logger.log(err);
Expand All @@ -97,6 +103,8 @@ const executeJs = async (req, res) => {
const jsProcess = spawn('node', [scriptPath]); // Command to execute the script
const result = await executeScript(scriptPath, jsProcess, false);

logger.logSuccess("Program executed successfully.");

res.json({ output: result });
} catch (err) {
logger.log(err);
Expand Down

0 comments on commit 55d2481

Please sign in to comment.