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 +1 -1
- package/scripts/create-snappy/cli.js +12 -33
package/package.json
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
402
|
-
const
|
|
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
|
-
//
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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ā
|
|
436
|
-
console.error(pc.gray(`
|
|
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
|
|