From 97563733dbc8e9952e2cb4aa739a63ea1b35c69f Mon Sep 17 00:00:00 2001 From: Tales Porto Date: Thu, 1 Apr 2021 13:34:29 +0200 Subject: [PATCH] Using the default protocol port instead of define it on the code. --- packages/docusaurus/src/commands/deploy.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus/src/commands/deploy.ts b/packages/docusaurus/src/commands/deploy.ts index 63d1b9d67e28e..3acda5e67914b 100644 --- a/packages/docusaurus/src/commands/deploy.ts +++ b/packages/docusaurus/src/commands/deploy.ts @@ -102,9 +102,7 @@ export default async function deploy( const githubHost = process.env.GITHUB_HOST || siteConfig.githubHost || 'github.com'; const githubPort = - process.env.GITHUB_PORT || siteConfig.githubPort || (useSSH && useSSH.toLowerCase() === 'true' - ? '22' - : '433'); + process.env.GITHUB_PORT || siteConfig.githubPort; const gitPass: string | undefined = process.env.GIT_PASS; let gitCredentials = `${gitUser}`; @@ -112,8 +110,8 @@ export default async function deploy( gitCredentials = `${gitCredentials}:${gitPass}`; } - const sshRemoteBranch: string = `ssh://git@${githubHost}:${githubPort}/${organizationName}/${projectName}.git`; - const nonSshRemoteBranch: string = `https://${gitCredentials}@${githubHost}:${githubPort}/${organizationName}/${projectName}.git`; + const sshRemoteBranch: string = `ssh://git@${githubHost}${githubPort ? ':' + githubPort : ''}/${organizationName}/${projectName}.git`; + const nonSshRemoteBranch: string = `https://${gitCredentials}@${githubHost}${githubPort ? ':' + githubPort : ''}/${organizationName}/${projectName}.git`; const remoteBranch = useSSH && useSSH.toLowerCase() === 'true'