diff --git a/.gitignore b/.gitignore index b6723d2d5..c974af773 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ Data-Storage Log-Files -My-Workspaces \ No newline at end of file +My-Workspaces diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 588eb9dad..c4bb087a3 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -526,6 +526,16 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE switch (requestParameters[2]) { // switch by command case 'Contribute': { try { + const GITHUB = require('Github.json') + if (GITHUB.user === 'Your Github.com Username' || GITHUB.user === 'Your Github.com Password' ) { + let error = { + result: 'Fail Because', + message: 'File Github.json does not exist.' + } + respondWithContent(JSON.stringify(error), httpResponse) + return + } + const simpleGit = require('simple-git'); const options = { baseDir: process.cwd(), @@ -534,6 +544,12 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } const git = simpleGit(options) const commitMessage = unescape(requestParameters[3]) + const USER = 'Luis-Fernando-Molina'; + const PASS = 'somewhere'; + const REPO = 'github.com/username/private-repo'; + + const remote = `https://${USER}:${PASS}@${REPO}`; + git .add('./*') .commit(commitMessage) diff --git a/Github.json b/Github.json new file mode 100644 index 000000000..121212663 --- /dev/null +++ b/Github.json @@ -0,0 +1,4 @@ +{ + "user": "Your Github.com Username", + "password": "Your Github.com Password" +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-topic-002-app-error-github-credentials-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-topic-002-app-error-github-credentials-missing.json new file mode 100644 index 000000000..1399cb53f --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-topic-002-app-error-github-credentials-missing.json @@ -0,0 +1,14 @@ +{ + "topic": "App Commands Errors Topic", + "pageNumber": "2", + "type": "App Error Github Credentials Missing", + "definition": { + "text": "Write here a summary for this topic page." + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index 6d5438ad7..7f7cea2e6 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -45,7 +45,11 @@ function newSuperalgosDocsCommmandInterface() { if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message Contribution Succeed') } else { - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error Contribution Not Sent', 'Anchor Contribution Not Sent') + if (data.error.message === 'File Github.json does not exist.') { + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error Github Credentials Missing', 'Anchor Github Credentials Missing') + } else { + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error Contribution Not Sent', 'Anchor Contribution Not Sent') + } } } }