Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make git clone work in sites:create-template #4772

Merged
merged 3 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@
"fuzzy": "^0.1.3",
"get-port": "^5.1.0",
"gh-release-fetch": "^3.0.0",
"git-clone": "^0.2.0",
"git-repo-info": "^2.1.0",
"gitconfiglocal": "^2.1.0",
"hasbin": "^1.2.3",
Expand Down
5 changes: 2 additions & 3 deletions src/commands/sites/sites-create-template.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-check

const clone = require('git-clone/promise')
const inquirer = require('inquirer')
const pick = require('lodash/pick')
const parseGitHubUrl = require('parse-github-url')
const prettyjson = require('prettyjson')

const { chalk, error, getRepoData, getTerminalLink, log, logJson, track, warn } = require('../../utils')
const { chalk, error, execa, getRepoData, getTerminalLink, log, logJson, track, warn } = require('../../utils')
const { configureRepo } = require('../../utils/init/config')
const { getGitHubToken } = require('../../utils/init/config-github')
const { createRepo, getTemplatesFromGitHub, validateTemplate } = require('../../utils/sites/utils')
Expand Down Expand Up @@ -190,7 +189,7 @@ const sitesCreateTemplate = async (repository, options, command) => {
})
if (cloneConfirm) {
log()
await clone(repoResp.git_url, `${repoResp.name}`)
await execa('git', ['clone', repoResp.clone_url, `${repoResp.name}`])
log(`🚀 Repository cloned successfully. You can find it under the ${chalk.magenta(repoResp.name)} folder`)
}

Expand Down