netlify-cli 9.12.5 → 9.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "9.12.5",
3
+ "version": "9.13.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "9.12.5",
9
+ "version": "9.13.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -55,6 +55,7 @@
55
55
  "fuzzy": "^0.1.3",
56
56
  "get-port": "^5.1.0",
57
57
  "gh-release-fetch": "^3.0.0",
58
+ "git-clone": "^0.2.0",
58
59
  "git-repo-info": "^2.1.0",
59
60
  "gitconfiglocal": "^2.1.0",
60
61
  "graphql": "^16.1.0",
@@ -13003,6 +13004,11 @@
13003
13004
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
13004
13005
  }
13005
13006
  },
13007
+ "node_modules/git-clone": {
13008
+ "version": "0.2.0",
13009
+ "resolved": "https://registry.npmjs.org/git-clone/-/git-clone-0.2.0.tgz",
13010
+ "integrity": "sha512-1UAkEPIFbyjHaddljUKvPhhLRnrKaImT71T7rdvSvWLXw95nLdhdi6Qmlx0KOWoV1qqvHGLq5lMLJEZM0JXk8A=="
13011
+ },
13006
13012
  "node_modules/git-raw-commits": {
13007
13013
  "version": "2.0.11",
13008
13014
  "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz",
@@ -33967,6 +33973,11 @@
33967
33973
  "semver": "^7.0.0"
33968
33974
  }
33969
33975
  },
33976
+ "git-clone": {
33977
+ "version": "0.2.0",
33978
+ "resolved": "https://registry.npmjs.org/git-clone/-/git-clone-0.2.0.tgz",
33979
+ "integrity": "sha512-1UAkEPIFbyjHaddljUKvPhhLRnrKaImT71T7rdvSvWLXw95nLdhdi6Qmlx0KOWoV1qqvHGLq5lMLJEZM0JXk8A=="
33980
+ },
33970
33981
  "git-raw-commits": {
33971
33982
  "version": "2.0.11",
33972
33983
  "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "9.12.5",
4
+ "version": "9.13.0",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
@@ -245,6 +245,7 @@
245
245
  "fuzzy": "^0.1.3",
246
246
  "get-port": "^5.1.0",
247
247
  "gh-release-fetch": "^3.0.0",
248
+ "git-clone": "^0.2.0",
248
249
  "git-repo-info": "^2.1.0",
249
250
  "gitconfiglocal": "^2.1.0",
250
251
  "graphql": "^16.1.0",
@@ -1,5 +1,6 @@
1
1
  // @ts-check
2
2
 
3
+ const clone = require('git-clone/promise')
3
4
  const inquirer = require('inquirer')
4
5
  const pick = require('lodash/pick')
5
6
  const parseGitHubUrl = require('parse-github-url')
@@ -111,6 +112,7 @@ const sitesCreateTemplate = async (repository, options, command) => {
111
112
  const { name: nameFlag } = options
112
113
  let user
113
114
  let site
115
+ let repoResp
114
116
 
115
117
  // Allow the user to reenter site name if selected one isn't available
116
118
  const inputSiteName = async (name) => {
@@ -120,7 +122,7 @@ const sitesCreateTemplate = async (repository, options, command) => {
120
122
  const siteName = inputName ? inputName.trim() : siteSuggestion
121
123
 
122
124
  // Create new repo from template
123
- const repoResp = await createRepo(templateName, ghToken, siteName)
125
+ repoResp = await createRepo(templateName, ghToken, siteName)
124
126
 
125
127
  if (repoResp.errors) {
126
128
  if (repoResp.errors[0].includes('Name already exists on this account')) {
@@ -181,6 +183,18 @@ const sitesCreateTemplate = async (repository, options, command) => {
181
183
  siteUrl,
182
184
  })
183
185
 
186
+ const { cloneConfirm } = await inquirer.prompt({
187
+ type: 'confirm',
188
+ name: 'cloneConfirm',
189
+ message: `Do you want to clone the repository?`,
190
+ default: true,
191
+ })
192
+ if (cloneConfirm) {
193
+ log()
194
+ await clone(repoResp.git_url, `${repoResp.name}`)
195
+ log(`🚀 Repository cloned successfully. You can find it under the ${chalk.magenta(repoResp.name)} folder`)
196
+ }
197
+
184
198
  if (options.withCi) {
185
199
  log('Configuring CI')
186
200
  const repoData = await getRepoData()