Added test cli functionality
This commit is contained in:
parent
ad6ab2ecab
commit
1d632252bf
2 changed files with 19 additions and 0 deletions
13
scoreboard/controllers/cli.js
Normal file
13
scoreboard/controllers/cli.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const exec = require('node:child_process');
|
||||
|
||||
// run the `ls` command using exec
|
||||
exec('ls ./', (err, output) => {
|
||||
// once the command has completed, the callback function is called
|
||||
if (err) {
|
||||
// log and return if we encounter an error
|
||||
console.error("could not execute command: ", err)
|
||||
return
|
||||
}
|
||||
// log the output received from the command
|
||||
console.log("Output: \n", output)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue