start implementing shell command utility

This commit is contained in:
Brenden Harrell committed 2021-10-01 07:41:29 -05:00
1 parent 00ce521972
commit f3bc0cdda8
3 files changed
+41 -23

No files matched your search

@@ -18,9 +18,11 @@ function newEducationActionSwitch() {
async function executeAction(action) {
switch (action.name) {
case 'Action Name': {
// Example: return UI.projects.foundations.functionLibraries.onFocus.getNodeThatIsOnFocus(action.node)
}
case 'Launch Shell Command':
{
UI.projects.education.functionLibraries.launchshellcommand.launchshellcommand(action.node)
}
break
}
}
}
@@ -0,0 +1,34 @@
const path = require("path");
const process = require("process");
const { exec } = require("child_process");
function newEducationFunctionLibraryLaunchShellCommand() {
let thisObject = {
launchShellCommand: launchShellCommand
}
return thisObject
function launchShellCommand() {
let dir = path.join( process.cwd(), "..", "..", "..", "..", ".." )
let command = "node setup";
exec( command,
{
cwd: dir
},
function ( error, stdout ){
if (error) {
console.log('');
console.log("There was an error updating dependencies for this branch: ");
console.log('');
console.log( error );
return;
}
console.log('');
console.log( stdout );
});
}
}