initial implementation of running node setup on branch switch in httpinterface

This commit is contained in:
Brenden Harrell committed 2021-10-01 08:39:30 -05:00
1 parent 978c6be82c
commit 90377568ac
4 files changed
+25 -40

No files matched your search

+22
View File
@@ -900,6 +900,28 @@ exports.newHttpInterface = function newHttpInterface() {
async function runNodeSetup () {
console.log( "lets run node setup" )
const path = require("path");
const process = require("process");
const { exec } = require("child_process");
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 );
});
}
} catch (err) {
@@ -18,10 +18,9 @@ function newEducationActionSwitch() {
async function executeAction(action) {
switch (action.name) {
case 'Launch Shell Command':
{
UI.projects.education.functionLibraries.launchshellcommand.launchshellcommand(action.node)
}
case 'Action Name': {
// Example: return UI.projects.foundations.functionLibraries.onFocus.getNodeThatIsOnFocus(action.node)
}
break
}
}
@@ -1,34 +0,0 @@
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 );
});
}
}
@@ -254,8 +254,6 @@ function newEducationDocSpace() {
if (doNotNavigate === true) { return }
// Run Node Setup to Update dependencies upon branch switch
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Current Branch Changed')
} else {