Skip to content

Commit 6cc1e40

Browse files
committed
some changes
2 parents fa58882 + 8ba1999 commit 6cc1e40

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

client/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PORT=5000
1+
PORT=8000

client/.eslintcache

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
[{"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/header/Header.js":"1","/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/output/InputOutput.js":"2"},{"size":388,"mtime":1609927468679,"results":"3","hashOfConfig":"4"},{"size":1054,"mtime":1609927468682,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kizngo",{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/header/Header.js",[],"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/output/InputOutput.js",[]]
1+
<<<<<<< HEAD
2+
[{"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/header/Header.js":"1","/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/output/InputOutput.js":"2"},{"size":388,"mtime":1609927468679,"results":"3","hashOfConfig":"4"},{"size":1054,"mtime":1609927468682,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kizngo",{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/header/Header.js",[],"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/output/InputOutput.js",[]]
3+
=======
4+
[{"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js":"1","/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/index.js":"2","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js":"3"},{"size":388,"mtime":1609839782860,"results":"4","hashOfConfig":"5"},{"size":111,"mtime":1609871540084,"results":"6","hashOfConfig":"5"},{"size":1054,"mtime":1609877085016,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ld0h7m",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/index.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js",[]]
5+
>>>>>>> 8ba1999345de29ac621848df532983f857213ca7

client/src/actions/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const executeCode = async (code, lang, input) => {
3232
console.log(error);
3333
return {
3434
type: SET_ERROR,
35-
payload: 'Something wrong'
35+
payload: 'Something went wrong'
3636
};
3737
}
3838
};

rce-server/server/api/services/code.service.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ const SOURCE_DIR = path.join(ROOT_DIR, "executor");
88
const TARGET_DIR = `/app/codes`;
99
const IMAGE_NAME = "executor:1.0";
1010
const VOL_NAME = `my_vol`;
11-
// const VOL_NAME = SOURCE_DIR;
11+
//const VOL_NAME = SOURCE_DIR;
1212

1313
class CodeService {
1414
async execute(code, input, lang, id) {
15-
// console.log('code', code);
16-
console.log(SOURCE_DIR);
15+
//console.log('code', code);
1716
try {
1817
!input ? (input = "") : null;
1918

@@ -168,10 +167,11 @@ class CodeService {
168167
if (err) throw { message: err };
169168
});
170169
}
171-
if (lang == "cpp") {
172-
fs.unlinkSync(path.join(SOURCE_DIR, id), (err) => {
173-
if (err) throw err;
174-
});
170+
if (lang == "cpp" || lang == "c") {
171+
if (fs.existsSync(path.join(SOURCE_DIR, id)))
172+
fs.unlinkSync(path.join(SOURCE_DIR, id), (err) => {
173+
if (err) throw err;
174+
});
175175
}
176176
if (lang == "java") {
177177
fs.unlinkSync(path.join(SOURCE_DIR, "Input.class"), (err) => {

rce-server/server/api/services/validation.service.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ class ValidationService {
2525
message: "You have unacceptable libs imported",
2626
};
2727
} else if (
28+
<<<<<<< HEAD
2829
words.every((el) => code.toLowerCase().includes(el.toLowerCase()))
30+
=======
31+
!words.every(el => code.toLowerCase().includes(el.toLowerCase()))
32+
>>>>>>> 8ba1999345de29ac621848df532983f857213ca7
2933
) {
3034
return {
3135
isValid: false,

0 commit comments

Comments
 (0)