Support des modules a tester

This commit is contained in:
Marc
2021-12-14 14:19:14 +01:00
parent 2209a9a36d
commit 4aee41a5d6
17 changed files with 368 additions and 27 deletions
+3
View File
@@ -0,0 +1,3 @@
const { lsmod } = require('/chibrax/kernel.js')
console.log(lsmod())
+3
View File
@@ -0,0 +1,3 @@
const { modprobe } = require('/chibrax/kernel.js')
if(process.argv[3])modprobe(process.argv[3])
else console.log("missing argument")
+8 -4
View File
@@ -64,10 +64,14 @@ function evaluateProgram(args){
const files = fs.readdirSync(path);
if(files.includes(`${args[0]}.js`)){
found = true;
//@ts-expect-error
const script = execSync(`${environment.node} ${path + '/' + args[0]}.js ${args.map(arg => {return arg.includes(' ') ? `"${arg}"` : arg}).join(' ')}`, {cwd: current_dir, env: environment, shell: true});
process.stdout.write(script)
tobreak = true;
try {
//@ts-expect-error
const script = execSync(`${environment.node} ${path + '/' + args[0]}.js ${args.map(arg => {return arg.includes(' ') ? `"${arg}"` : arg}).join(' ')}`, {cwd: current_dir, env: environment, shell: true});
process.stdout.write(script)
tobreak = true;
} catch(e) {
console.log("Program crashed")
}
}
if(tobreak) break;