create-snappy 1.1.4 → 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.4",
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.4)'))
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,47 +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
406
- try {
407
- execSync(`git clone --depth 1 -b ${selectedTemplate} ${repoUrl} "${targetDir}"`, {
408
- stdio: 'ignore',
409
- })
410
- cloneSpinner.succeed('Project cloned successfully.')
411
- } catch (publicErr) {
412
- // If public fails, try with token
413
- let token = getSavedToken()
414
-
415
- if (!token) {
416
- cloneSpinner.stop()
417
- console.log(pc.yellow('\nšŸ” Access denied or repository is private. Please authenticate...'))
418
- token = await githubLogin()
419
- }
420
-
421
- if (token) {
422
- const authenticatedUrl = repoUrl.replace('https://', `https://x-access-token:${token}@`)
423
- const retrySpinner = ora(`Cloning secure template (${selectedTemplate}) with authentication...`).start()
424
- try {
425
- execSync(`git clone --depth 1 -b ${selectedTemplate} ${authenticatedUrl} "${targetDir}"`, {
426
- stdio: 'ignore',
427
- })
428
- retrySpinner.succeed('Project cloned successfully (authenticated).')
429
- } catch (authErr) {
430
- retrySpinner.fail('Authentication failed or repository inaccessible.')
431
- throw authErr
432
- }
433
- } else {
434
- throw new Error('No GitHub token available for private access.')
435
- }
436
- }
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.')
437
411
  } catch (err) {
438
- if (cloneSpinner.isSpinning) cloneSpinner.stop()
412
+ cloneSpinner.stop()
439
413
  console.error(pc.red("\nāŒ Installation failed during project cloning."))
440
- console.error(pc.gray(`Target Template: ${selectedTemplate}`))
441
- console.error(pc.gray(`Source Repository: ${repoUrl}`))
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.`))
442
416
  throw err
443
417
  }
444
418