create-audora-next 0.1.4 → 0.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/index.ts +9 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -48,18 +48,27 @@ cpSync(new URL("./templates/base", import.meta.url), targetDir, {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
// Rename template files that npm excludes during publish
|
|
51
|
+
const templateSpinner = ora("Setting up configuration files...").start();
|
|
51
52
|
const templateFiles = [
|
|
52
53
|
{ from: "gitignore.template", to: ".gitignore" },
|
|
53
54
|
{ from: "env.example.template", to: ".env.example" },
|
|
54
55
|
];
|
|
55
56
|
|
|
57
|
+
let renamedCount = 0;
|
|
56
58
|
for (const { from, to } of templateFiles) {
|
|
57
59
|
const filePath = join(targetDir, from);
|
|
58
60
|
if (existsSync(filePath)) {
|
|
59
61
|
renameSync(filePath, join(targetDir, to));
|
|
62
|
+
renamedCount++;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
|
|
66
|
+
if (renamedCount > 0) {
|
|
67
|
+
templateSpinner.succeed("Configuration files ready");
|
|
68
|
+
} else {
|
|
69
|
+
templateSpinner.warn("No template files found to rename");
|
|
70
|
+
}
|
|
71
|
+
|
|
63
72
|
process.chdir(targetDir);
|
|
64
73
|
|
|
65
74
|
// Init git (optional - warn if git not available)
|