@betterstart/cli 0.1.15 → 0.1.16
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/cli.js +14 -0
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13599,6 +13599,7 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13599
13599
|
let cwd = process.cwd();
|
|
13600
13600
|
let project = detectProject(cwd);
|
|
13601
13601
|
let pm = detectPackageManager(cwd);
|
|
13602
|
+
let isFreshProject = false;
|
|
13602
13603
|
let srcDir;
|
|
13603
13604
|
if (project.isExisting) {
|
|
13604
13605
|
p4.log.info(`Existing Next.js project detected`);
|
|
@@ -13695,6 +13696,7 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13695
13696
|
}
|
|
13696
13697
|
p4.log.success(`Created ${displayName} Next.js project`);
|
|
13697
13698
|
project = detectProject(cwd);
|
|
13699
|
+
isFreshProject = true;
|
|
13698
13700
|
}
|
|
13699
13701
|
const features = options.yes ? { includeEmail: true, preset: options.preset } : await promptFeatures(options.preset);
|
|
13700
13702
|
let databaseUrl;
|
|
@@ -13877,6 +13879,18 @@ var initCommand = new Command3("init").description("Scaffold CMS into a new or e
|
|
|
13877
13879
|
forms: formNames
|
|
13878
13880
|
});
|
|
13879
13881
|
}
|
|
13882
|
+
if (isFreshProject) {
|
|
13883
|
+
try {
|
|
13884
|
+
execFileSync4("git", ["init"], { cwd, stdio: "pipe" });
|
|
13885
|
+
execFileSync4("git", ["add", "."], { cwd, stdio: "pipe" });
|
|
13886
|
+
execFileSync4("git", ["commit", "-m", "Initial commit from BetterStart"], {
|
|
13887
|
+
cwd,
|
|
13888
|
+
stdio: "pipe"
|
|
13889
|
+
});
|
|
13890
|
+
p4.log.success("Created initial git commit");
|
|
13891
|
+
} catch {
|
|
13892
|
+
}
|
|
13893
|
+
}
|
|
13880
13894
|
const totalFiles = baseFiles.length + dbFiles.length + authFiles.length + compFiles.length + layoutFiles.length + apiFiles.length;
|
|
13881
13895
|
const summaryLines = [
|
|
13882
13896
|
`Preset: ${pc2.cyan(features.preset)}`,
|