-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexecuteCpp.js
34 lines (26 loc) · 885 Bytes
/
executeCpp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const {exec} = require('child_process');
const fs = require('fs');
const path = require('path');
const outputPath = path.join(__dirname,"outputs");
if(!fs.existsSync(outputPath)){
fs.mkdirSync(outputPath,{recursive:true});
}
const executeCpp = async({language,code ,input,inputRadio}) =>{
console.log("from execute : ",language)
console.log("from execute : ",code)
console.log("from execute : ",input)
console.log("from execute : ",inputRadio)
}
module.exports = {
executeCpp
};
// exec(`gcc ${filepath} -o ${outPath} && cd ${outputPath} && ${outPath} `,
// // exec (`g++ ${filepath} -o ${outPath} && cd ${outputPath} && ./${jobId}.out`,
// (error, stdout, stderr)=>{
// error && reject({error,stderr});
// console.log(error);
// stderr && reject(stderr);
// console.log(stderr);
// resolve(stdout);
// console.log(stdout);
// });