create-snappy 1.1.3 → 1.1.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-snappy",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "The official installer for the SNAPPY stack.",
5
5
  "main": "scripts/create-snappy/cli.js",
6
6
  "bin": {
@@ -160,7 +160,7 @@ function getPackageManager() {
160
160
 
161
161
  async function main() {
162
162
  console.log(pc.cyan(SNAPPY_LOGO))
163
- console.log(pc.cyan('šŸš€ Welcome to the SNAPPY Stack Installer! (v1.1.3)'))
163
+ console.log(pc.cyan('šŸš€ Welcome to the SNAPPY Stack Installer! (v1.1.5)'))
164
164
  console.log('------------------------------------------')
165
165
 
166
166
  const program = new Command()
@@ -398,42 +398,21 @@ async function main() {
398
398
 
399
399
  try {
400
400
  // 1. Initialize from repository
401
- const repoUrl = process.env.SNAPPY_REPO_URL || 'https://github.com/Snappy-Stack/snappy'
402
- const cloneSpinner = ora(`Cloning secure template (${selectedTemplate})...`).start()
401
+ // 1. Initialize from repository
402
+ const repoUrl = 'https://github.com/Snappy-Stack/snappy'
403
+ const cloneSpinner = ora(`Cloning template (${selectedTemplate})...`).start()
403
404
 
404
405
  try {
405
- // Try public clone first for public repo
406
- try {
407
- execSync(`git clone --depth 1 -b ${selectedTemplate} ${repoUrl} "${targetDir}"`, {
408
- stdio: 'ignore',
409
- })
410
- cloneSpinner.succeed('Project cloned successfully (public).')
411
- } catch (publicErr) {
412
- // If public fails, try with token
413
- const token = getSavedToken()
414
- if (token) {
415
- const authenticatedUrl = repoUrl.replace('https://', `https://x-access-token:${token}@`)
416
- execSync(`git clone --depth 1 -b ${selectedTemplate} ${authenticatedUrl} "${targetDir}"`, {
417
- stdio: 'ignore',
418
- })
419
- cloneSpinner.succeed('Project cloned successfully (authenticated).')
420
- } else {
421
- // No token, ask for one
422
- cloneSpinner.stop()
423
- console.log(pc.yellow('\nšŸ” This template might be private. Please authenticate...'))
424
- const newToken = await githubLogin()
425
- const authenticatedUrl = repoUrl.replace('https://', `https://x-access-token:${newToken}@`)
426
- const retrySpinner = ora(`Cloning secure template (${selectedTemplate})...`).start()
427
- execSync(`git clone --depth 1 -b ${selectedTemplate} ${authenticatedUrl} "${targetDir}"`, {
428
- stdio: 'ignore',
429
- })
430
- retrySpinner.succeed('Project cloned successfully.')
431
- }
432
- }
406
+ // Clean public clone only
407
+ execSync(`git clone --depth 1 -b ${selectedTemplate} ${repoUrl} "${targetDir}"`, {
408
+ stdio: 'ignore',
409
+ })
410
+ cloneSpinner.succeed('Project cloned successfully.')
433
411
  } catch (err) {
434
412
  cloneSpinner.stop()
435
- console.error(pc.red("\nāŒ Clone failed. The branch might not exist, or you don't have access."))
436
- console.error(pc.gray(`Command: git clone -b ${selectedTemplate} ${repoUrl}`))
413
+ console.error(pc.red("\nāŒ Installation failed during project cloning."))
414
+ console.error(pc.gray(`Template: ${selectedTemplate}`))
415
+ console.error(pc.gray(`If this is a private template, ensure you have git access to the repository.`))
437
416
  throw err
438
417
  }
439
418