create-astro 3.1.5 → 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 -4
- 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) {
|
|
@@ -788,10 +788,16 @@ var FILES_TO_UPDATE = {
|
|
|
788
788
|
);
|
|
789
789
|
})
|
|
790
790
|
};
|
|
791
|
-
|
|
792
|
-
const ref = ctx.ref || "latest";
|
|
791
|
+
function getTemplateTarget(tmpl, ref = "latest") {
|
|
793
792
|
const isThirdParty = tmpl.includes("/");
|
|
794
|
-
|
|
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);
|
|
795
801
|
if (!ctx.dryRun) {
|
|
796
802
|
try {
|
|
797
803
|
await downloadTemplate(templateTarget, {
|