Skip to content

Commit 8ba1999

Browse files
committed
minor fixes
1 parent 364e9b2 commit 8ba1999

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"/home/tomarviii88/Documents/projects/extras/rce-client/src/index.js":"1","/home/tomarviii88/Documents/projects/extras/rce-client/src/App.js":"2","/home/tomarviii88/Documents/projects/extras/rce-client/src/reportWebVitals.js":"3","/home/tomarviii88/Documents/projects/extras/rce-client/src/reducers/test.js":"4","/home/tomarviii88/Desktop/remote-code-executor/client/src/App.js":"5","/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/index.js":"6","/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/global.js":"7","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js":"8","/home/tomarviii88/Desktop/remote-code-executor/client/src/utils/useDarkMode.js":"9","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/ToggleTheme.js":"10","/home/tomarviii88/Desktop/remote-code-executor/client/src/reportWebVitals.js":"11","/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/theme.js":"12","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js":"13","/home/tomarviii88/Desktop/remote-code-executor/client/src/actions/code.js":"14","/home/tomarviii88/Desktop/remote-code-executor/client/src/actions/type.js":"15","/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/code.js":"16","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js":"17","/home/tomarviii88/Desktop/remote-code-executor/client/src/index.js":"18"},{"size":701,"mtime":1609754358823,"results":"19","hashOfConfig":"20"},{"size":359,"mtime":1609754034059,"results":"21","hashOfConfig":"20"},{"size":362,"mtime":1609701597824,"results":"22","hashOfConfig":"20"},{"size":166,"mtime":1609753392495,"results":"23","hashOfConfig":"20"},{"size":860,"mtime":1609876868768,"results":"24","hashOfConfig":"25"},{"size":111,"mtime":1609871540084,"results":"26","hashOfConfig":"25"},{"size":507,"mtime":1609840127280,"results":"27","hashOfConfig":"25"},{"size":388,"mtime":1609839782860,"results":"28","hashOfConfig":"25"},{"size":783,"mtime":1609837554564,"results":"29","hashOfConfig":"25"},{"size":1657,"mtime":1609840978068,"results":"30","hashOfConfig":"25"},{"size":362,"mtime":1609769185588,"results":"31","hashOfConfig":"25"},{"size":285,"mtime":1609835248504,"results":"32","hashOfConfig":"25"},{"size":1689,"mtime":1609922278357,"results":"33","hashOfConfig":"25"},{"size":857,"mtime":1609922703181,"results":"34","hashOfConfig":"25"},{"size":130,"mtime":1609875654168,"results":"35","hashOfConfig":"25"},{"size":650,"mtime":1609875966348,"results":"36","hashOfConfig":"25"},{"size":1054,"mtime":1609877085016,"results":"37","hashOfConfig":"25"},{"size":788,"mtime":1609866581376,"results":"38","hashOfConfig":"25"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"h55o50",{"filePath":"41","messages":"42","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"47","messages":"48","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"1ld0h7m",{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tomarviii88/Documents/projects/extras/rce-client/src/index.js",[],"/home/tomarviii88/Documents/projects/extras/rce-client/src/App.js",["75","76"],"/home/tomarviii88/Documents/projects/extras/rce-client/src/reportWebVitals.js",[],"/home/tomarviii88/Documents/projects/extras/rce-client/src/reducers/test.js",["77"],"/home/tomarviii88/Desktop/remote-code-executor/client/src/App.js",["78"],"/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/index.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/global.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/utils/useDarkMode.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/ToggleTheme.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/reportWebVitals.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/theme.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/actions/code.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/actions/type.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/reducers/code.js",["79"],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/index.js",[],{"ruleId":"80","severity":1,"message":"81","line":5,"column":9,"nodeType":"82","messageId":"83","endLine":5,"endColumn":17},{"ruleId":"84","severity":1,"message":"85","line":10,"column":6,"nodeType":"86","endLine":10,"endColumn":8,"suggestions":"87"},{"ruleId":"88","severity":1,"message":"89","line":5,"column":1,"nodeType":"90","endLine":10,"endColumn":2},{"ruleId":"80","severity":1,"message":"91","line":8,"column":8,"nodeType":"82","messageId":"83","endLine":8,"endColumn":19},{"ruleId":"88","severity":1,"message":"89","line":9,"column":1,"nodeType":"90","endLine":33,"endColumn":2},"no-unused-vars","'dispatch' is assigned a value but never used.","Identifier","unusedVar","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'test'. Either include it or remove the dependency array.","ArrayExpression",["92"],"import/no-anonymous-default-export","Unexpected default export of anonymous function","ExportDefaultDeclaration","'InputOutput' is defined but never used.",{"desc":"93","fix":"94"},"Update the dependencies array to be: [test]",{"range":"95","text":"96"},[251,253],"[test]"]
1+
[{"/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",[]]

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: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const ROOT_DIR = `${process.cwd()}`;
77
const SOURCE_DIR = path.join(ROOT_DIR, 'executor');
88
const TARGET_DIR = `/app/codes`;
99
const IMAGE_NAME = 'executor:1.0';
10-
//const VOL_NAME = `my_vol`;
11-
const VOL_NAME = SOURCE_DIR;
10+
const VOL_NAME = `my_vol`;
11+
//const VOL_NAME = SOURCE_DIR;
1212

1313
class CodeService {
1414
async execute(code, input, lang, id) {
15-
console.log('code', code);
15+
//console.log('code', code);
1616
try {
1717
!input ? (input = '') : null;
1818

@@ -167,10 +167,11 @@ class CodeService {
167167
if (err) throw { message: err };
168168
});
169169
}
170-
if (lang == 'cpp') {
171-
fs.unlinkSync(path.join(SOURCE_DIR, id), err => {
172-
if (err) throw err;
173-
});
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+
});
174175
}
175176
if (lang == 'java') {
176177
fs.unlinkSync(path.join(SOURCE_DIR, 'Input.class'), err => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ValidationService {
2424
message: 'You have unacceptable libs imported'
2525
};
2626
} else if (
27-
words.every(el => code.toLowerCase().includes(el.toLowerCase()))
27+
!words.every(el => code.toLowerCase().includes(el.toLowerCase()))
2828
) {
2929
return {
3030
isValid: false,

0 commit comments

Comments
 (0)