create-bingstack-app 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/index.mjs +18 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -46,6 +46,12 @@ async function main() {
46
46
  })
47
47
  if (p.isCancel(pkgManager)) return cancel()
48
48
 
49
+ const { failed } = await execa(pkgManager, ['--version'], { reject: false })
50
+ if (failed) {
51
+ p.log.error(`${pkgManager} is not installed. Please install it and try again.`)
52
+ process.exit(1)
53
+ }
54
+
49
55
  const targetDir = path.resolve(process.cwd(), projectName)
50
56
 
51
57
  if (existsSync(targetDir)) {
@@ -89,6 +95,18 @@ async function main() {
89
95
  s.stop('Dependencies installed')
90
96
  }
91
97
 
98
+ const initGit = await p.confirm({
99
+ message: 'Initialize a git repository?',
100
+ initialValue: true,
101
+ })
102
+ if (p.isCancel(initGit)) return cancel()
103
+
104
+ if (initGit) {
105
+ await execa('git', ['init'], { cwd: targetDir })
106
+ await execa('git', ['add', '-A'], { cwd: targetDir })
107
+ await execa('git', ['commit', '-m', 'Initial commit'], { cwd: targetDir })
108
+ }
109
+
92
110
  p.outro(
93
111
  `Done! Next steps:\n\n` +
94
112
  ` cd ${projectName}\n` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bingstack-app",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Create a new Bingstack app with auth, routing, and database pre-configured",
5
5
  "type": "module",
6
6
  "bin": {