Skip to content

Commit

Permalink
If someone uses a private repo git address accessed over ssh use that…
Browse files Browse the repository at this point in the history
… otherwise use normal git address
  • Loading branch information
KyleAMathews committed Jan 27, 2018
1 parent 908fa66 commit 92a7dd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/gatsby-cli/src/init-starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ const copy = async (starterPath: string, rootPath: string) => {

// Clones starter from URI.
const clone = async (hostInfo: any, rootPath: string) => {
const url = hostInfo.ssh({ noCommittish: true })
let url
// Let people use private repos accessed over SSH.
if (hostInfo.getDefaultRepresentation() === `sshurl`) {
url = hostInfo.ssh({ noCommittish: true })
// Otherwise default to normal git syntax.
} else {
url = hostInfo.git({ noCommittish: true })
}

const branch = hostInfo.committish ? `-b ${hostInfo.committish}` : ``

report.info(`Creating new site from git: ${url}`)
Expand Down

0 comments on commit 92a7dd8

Please sign in to comment.