|
|
@ -115,15 +115,15 @@ module.exports = {
|
|
|
|
|
|
|
|
|
|
|
|
return self._git.exec('remote', 'show').then((cProc) => {
|
|
|
|
return self._git.exec('remote', 'show').then((cProc) => {
|
|
|
|
let out = cProc.stdout.toString()
|
|
|
|
let out = cProc.stdout.toString()
|
|
|
|
if (_.includes(out, 'origin')) {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return Promise.each(gitConfigs, fn => { return fn() }).then(() => {
|
|
|
|
return Promise.each(gitConfigs, fn => { return fn() }).then(() => {
|
|
|
|
|
|
|
|
if (!_.includes(out, 'origin')) {
|
|
|
|
return self._git.exec('remote', ['add', 'origin', self._url])
|
|
|
|
return self._git.exec('remote', ['add', 'origin', self._url])
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return self._git.exec('remote', ['set-url', 'origin', self._url])
|
|
|
|
|
|
|
|
}
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
winston.error(err)
|
|
|
|
winston.error(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
winston.error('[' + PROCNAME + '.Git] Git remote error!')
|
|
|
|
winston.error('[' + PROCNAME + '.Git] Git remote error!')
|
|
|
|