From 3442442017cdcaf5499dd2e06f6ee6327b292f29 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Fri, 1 Oct 2021 07:10:56 -0500 Subject: [PATCH] Revert "start implementing shell command utility" This reverts commit 61ec81e0921acb9910eafc8e708e6638f62c06b5. --- .../UI/Function-Libraries/ActionSwitch.js | 8 ++--- .../Function-Libraries/LaunchShellCommand.js | 34 ------------------- .../UI/Spaces/Docs-Space/DocsSpace.js | 22 ++++++++++-- 3 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 Projects/Education/UI/Function-Libraries/LaunchShellCommand.js diff --git a/Projects/Education/UI/Function-Libraries/ActionSwitch.js b/Projects/Education/UI/Function-Libraries/ActionSwitch.js index ff5c8bc37..03bf636ca 100644 --- a/Projects/Education/UI/Function-Libraries/ActionSwitch.js +++ b/Projects/Education/UI/Function-Libraries/ActionSwitch.js @@ -18,11 +18,9 @@ function newEducationActionSwitch() { async function executeAction(action) { switch (action.name) { - case 'Launch Shell Command': - { - UI.projects.education.functionLibraries.launchshellcommand.launchshellcommand(action.node) - } - break + case 'Action Name': { + // Example: return UI.projects.foundations.functionLibraries.onFocus.getNodeThatIsOnFocus(action.node) + } } } } diff --git a/Projects/Education/UI/Function-Libraries/LaunchShellCommand.js b/Projects/Education/UI/Function-Libraries/LaunchShellCommand.js deleted file mode 100644 index fe9e06b7b..000000000 --- a/Projects/Education/UI/Function-Libraries/LaunchShellCommand.js +++ /dev/null @@ -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 ); - }); - } -} \ No newline at end of file diff --git a/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js index 1e5951e80..a43d55e62 100644 --- a/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js @@ -244,6 +244,9 @@ function newEducationDocSpace() { UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Changing Current Branch') } + const path = require("path"); + const process = require("process"); + const { exec } = require("child_process"); function onResponse(err, data) { /* Lets check the result of the call through the http interface */ data = JSON.parse(data) @@ -255,9 +258,24 @@ function newEducationDocSpace() { if (doNotNavigate === true) { return } // Run Node Setup to Update dependencies upon branch switch - + 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; + } UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Current Branch Changed') - + console.log(''); + console.log( stdout ); + }); } else { UI.projects.education.spaces.docsSpace.navigateTo( data.docs.project,