Github Credentials File
This commit is contained in:
1 parent
70115db226
commit
505498d76d
5 files changed
+40
-2
No files matched your search
+1
-1
@@ -1,3 +1,3 @@
|
||||
Data-Storage
|
||||
Log-Files
|
||||
My-Workspaces
|
||||
My-Workspaces
|
||||
@@ -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)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"user": "Your Github.com Username",
|
||||
"password": "Your Github.com Password"
|
||||
}
|
||||
+14
@@ -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."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user