Pārlūkot izejas kodu

Fised git add remote

master
pb pirms 3 gadiem
vecāks
revīzija
274c3c89eb
1 mainītis faili ar 34 papildinājumiem un 20 dzēšanām
  1. 34
    20
      index.js

+ 34
- 20
index.js Parādīt failu

@@ -528,7 +528,7 @@ var op = {
}

var perform_git_seturl = (dir) => {
op['is-git-repo'](dir).then((code) => {
op['is-git-repo'](dir).then((logEntry) => {
any(serial_perform_git_seturl(dir.name).map(x))
}).catch((e) => {
// console.log('Failed : ' + dir.name)
@@ -571,9 +571,9 @@ var op = {
// return Promise.resolve(true)
}
var perform_git_add = (dir) => {
op['is-git-repo'](dir).then((code) => {
op['is-git-repo'](dir).then((logEntry) => {
// console.log(code)
if (code) {
if (logEntry.success) {
nodeShellExec('git', ['remote', 'get-url', remotename], { cwd: dir.name, stdio: 'ignore' }).then(() => {
console.log('skipped : ' + dir.name + ', reason : A remote with same name already exists.')
})
@@ -608,9 +608,9 @@ var op = {
// return Promise.resolve(true)
}
var perform_git_remove = (dir) => {
op['is-git-repo'](dir).then((code) => {
op['is-git-repo'](dir).then((logEntry) => {
// console.log(code)
if (code) {
if (logEntry.success) {
nodeShellExec('git', ['remote', 'get-url', remotename], { cwd: dir.name, stdio: 'ignore' }).then(() => {
any(serial_perform_git_remove(dir.name).map(x))
})
@@ -648,9 +648,9 @@ var op = {
// return Promise.resolve(true)
}
var perform_init_gitea = (dir) => {
op['is-git-repo'](dir).then((code) => {
op['is-git-repo'](dir).then((logEntry) => {
// console.log(code)
if (code) {
if (logEntry.success) {
nodeShellExec('git', ['remote', 'get-url', 'chess'], { cwd: dir.name, stdio: 'ignore' }).then(() => {
console.log('skipped : ' + dir.name + ', reason : Already has remote chess ')
})
@@ -1903,25 +1903,39 @@ acquireElevationState().then(() => {
return chessinstances
}


var noprerequisites = {
add : true
}
var skipprereqs = {}
var maintask = () => {
// Default cmd to run !
processedArgs._[0] === processedArgs._[0] || 'pull';
// selectedinstance.reposerver = repomanifest.reposervers[0] // PB : TODO -- Attempt first one that is available and online from all that are available...
return prerequisites.git.verifyAndInstall().then(()=>{
var e = { message : 'verifyAndInstall', success : true}
return acquireConfig(selectedinstance, chessinstances).catch((err) => {
e = err;
console.error('Chosen cofiguraton failed or not found. Fix config and rerun or chose another.')
console.error(err)
}).then(() => { return elxrworker(true) })
// .finally(()=>{
// fs.writeFileSync('run.log', ', ' + JSON.stringify({ error: e.message }), { 'flag': 'a+' })
// if(!e.success) fs.writeFileSync('run.done', 'error');
// // return process.exit()
// })
})
if(!noprerequisites[processedArgs._[0]]
&& !skipprereqs[processedArgs._[0]]
) {
return prerequisites.git.verifyAndInstall().then(()=>{
var e = { message : 'verifyAndInstall', success : true}
return acquireConfig(selectedinstance, chessinstances).catch((err) => {
e = err;
console.error('Chosen cofiguraton failed or not found. Fix config and rerun or chose another.')
console.error(err)
}).then(() => { return elxrworker(true) })
// .finally(()=>{
// fs.writeFileSync('run.log', ', ' + JSON.stringify({ error: e.message }), { 'flag': 'a+' })
// if(!e.success) fs.writeFileSync('run.done', 'error');
// // return process.exit()
// })
})
}
else {
console.log('cmd has no preqs or has been configured to skip preqs')
return elxrworker()
}

}

const retaincount = 2

Notiek ielāde…
Atcelt
Saglabāt