create-astro 3.1.4 → 3.1.6
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/dist/index.js +10 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -368,7 +368,7 @@ function printHelp({
|
|
|
368
368
|
if (headline) {
|
|
369
369
|
message.push(
|
|
370
370
|
linebreak(),
|
|
371
|
-
`${title(commandName)} ${color.green(`v${"3.1.
|
|
371
|
+
`${title(commandName)} ${color.green(`v${"3.1.6"}`)} ${headline}`
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
if (usage) {
|
|
@@ -490,15 +490,6 @@ async function dependencies(ctx) {
|
|
|
490
490
|
start: `Dependencies installing with ${ctx.pkgManager}...`,
|
|
491
491
|
end: "Dependencies installed",
|
|
492
492
|
while: () => {
|
|
493
|
-
return Promise.reject("Unknown error").catch((e) => {
|
|
494
|
-
error("error", e);
|
|
495
|
-
error(
|
|
496
|
-
"error",
|
|
497
|
-
`Dependencies failed to install, please run ${color2.bold(
|
|
498
|
-
ctx.pkgManager + " install"
|
|
499
|
-
)} to install them manually after setup.`
|
|
500
|
-
);
|
|
501
|
-
});
|
|
502
493
|
return install({ pkgManager: ctx.pkgManager, cwd: ctx.cwd }).catch((e) => {
|
|
503
494
|
error("error", e);
|
|
504
495
|
error(
|
|
@@ -797,10 +788,16 @@ var FILES_TO_UPDATE = {
|
|
|
797
788
|
);
|
|
798
789
|
})
|
|
799
790
|
};
|
|
800
|
-
|
|
801
|
-
const ref = ctx.ref || "latest";
|
|
791
|
+
function getTemplateTarget(tmpl, ref = "latest") {
|
|
802
792
|
const isThirdParty = tmpl.includes("/");
|
|
803
|
-
|
|
793
|
+
if (isThirdParty)
|
|
794
|
+
return tmpl;
|
|
795
|
+
if (tmpl === "starlight")
|
|
796
|
+
return `withastro/starlight/examples/basics`;
|
|
797
|
+
return `github:withastro/astro/examples/${tmpl}#${ref}`;
|
|
798
|
+
}
|
|
799
|
+
async function copyTemplate(tmpl, ctx) {
|
|
800
|
+
const templateTarget = getTemplateTarget(tmpl, ctx.ref);
|
|
804
801
|
if (!ctx.dryRun) {
|
|
805
802
|
try {
|
|
806
803
|
await downloadTemplate(templateTarget, {
|