Commit 6a00a5db authored by NGPixel's avatar NGPixel Committed by Nicolas Giard

fix: git ssh port incorrect default value

parent 7cd5721c
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
hide-details hide-details
color='primary' color='primary'
) )
v-col(cols='8') v-col(:cols='gitAuthMode === `ssh` ? 6 : 8')
v-text-field( v-text-field(
outlined outlined
label='Repository URL' label='Repository URL'
...@@ -52,6 +52,14 @@ ...@@ -52,6 +52,14 @@
hide-details hide-details
v-model='gitRepoUrl' v-model='gitRepoUrl'
) )
v-col(v-if='gitAuthMode === `ssh`', cols='2')
v-text-field(
label='Port'
placeholder='e.g. 22'
v-model='gitRepoPort'
outlined
hide-details
)
v-col(cols='4') v-col(cols='4')
v-text-field( v-text-field(
label='Branch' label='Branch'
...@@ -296,6 +304,7 @@ export default { ...@@ -296,6 +304,7 @@ export default {
], ],
gitVerifySSL: true, gitVerifySSL: true,
gitRepoUrl: '', gitRepoUrl: '',
gitRepoPort: 22,
gitRepoBranch: 'master', gitRepoBranch: 'master',
gitPrivKey: '', gitPrivKey: '',
gitUsername: '', gitUsername: '',
...@@ -387,6 +396,7 @@ export default { ...@@ -387,6 +396,7 @@ export default {
{ key: 'authType', value: { value: this.gitAuthMode } }, { key: 'authType', value: { value: this.gitAuthMode } },
{ key: 'repoUrl', value: { value: this.gitRepoUrl } }, { key: 'repoUrl', value: { value: this.gitRepoUrl } },
{ key: 'branch', value: { value: this.gitRepoBranch } }, { key: 'branch', value: { value: this.gitRepoBranch } },
{ key: 'sshPort', value: { value: this.gitRepoPort } },
{ key: 'sshPrivateKeyMode', value: { value: 'contents' } }, { key: 'sshPrivateKeyMode', value: { value: 'contents' } },
{ key: 'sshPrivateKeyPath', value: { value: '' } }, { key: 'sshPrivateKeyPath', value: { value: '' } },
{ key: 'sshPrivateKeyContent', value: { value: this.gitPrivKey } }, { key: 'sshPrivateKeyContent', value: { value: this.gitPrivKey } },
......
...@@ -77,7 +77,7 @@ module.exports = { ...@@ -77,7 +77,7 @@ module.exports = {
throw err throw err
} }
} }
if (this.config.sshPort <= 0) { if (!this.config.sshPort || !_.isSafeInteger(this.config.sshPort) || this.config.sshPort <= 0) {
this.config.sshPort = 22 this.config.sshPort = 22
} }
await this.git.addConfig('core.sshCommand', `ssh -i "${this.config.sshPrivateKeyPath}" -o StrictHostKeyChecking=no -p ${this.config.sshPort}`) await this.git.addConfig('core.sshCommand', `ssh -i "${this.config.sshPrivateKeyPath}" -o StrictHostKeyChecking=no -p ${this.config.sshPort}`)
......
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