Commit 642bcac4 authored by NGPixel's avatar NGPixel

Set git remote on init

parent b004362a
...@@ -115,15 +115,15 @@ module.exports = { ...@@ -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 Promise.each(gitConfigs, fn => { return fn() }).then(() => {
return true if (!_.includes(out, 'origin')) {
} else {
return Promise.each(gitConfigs, fn => { return fn() }).then(() => {
return self._git.exec('remote', ['add', 'origin', self._url]) return self._git.exec('remote', ['add', 'origin', self._url])
}).catch(err => { } else {
winston.error(err) return self._git.exec('remote', ['set-url', 'origin', self._url])
}) }
} }).catch(err => {
winston.error(err)
})
}) })
}).catch((err) => { }).catch((err) => {
winston.error('[' + PROCNAME + '.Git] Git remote error!') winston.error('[' + PROCNAME + '.Git] Git remote error!')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment