@stacksjs/buddy 0.58.68 → 0.58.69

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.
@@ -1659,19 +1659,7 @@ async function initializeProject(options) {
1659
1659
  process25.exit(ExitCode18.FatalError);
1660
1660
  }
1661
1661
  log22.success("Installed node_modules");
1662
- log22.info("Ensuring .env exists...");
1663
- if (storage.doesNotExist(p4.projectPath(".env"))) {
1664
- const envResult = await runCommand8("cp .env.example .env", {
1665
- cwd: options.cwd || p4.projectPath()
1666
- });
1667
- if (envResult.isErr()) {
1668
- handleError2(envResult.error);
1669
- process25.exit(ExitCode18.FatalError);
1670
- }
1671
- log22.success(".env created");
1672
- } else {
1673
- log22.success(".env existed");
1674
- }
1662
+ ensureEnvIsSet(options);
1675
1663
  const keyResult = await runCommand8("buddy key:generate", {
1676
1664
  cwd: options.cwd || p4.projectPath()
1677
1665
  });
@@ -1694,6 +1682,21 @@ async function initializeProject(options) {
1694
1682
  async function optimizePkgxDeps() {
1695
1683
  return new Promise((resolve2) => setTimeout(resolve2, 300));
1696
1684
  }
1685
+ async function ensureEnvIsSet(options) {
1686
+ log22.info("Ensuring .env exists...");
1687
+ if (storage.doesNotExist(p4.projectPath(".env"))) {
1688
+ const envResult = await runCommand8("cp .env.example .env", {
1689
+ cwd: options.cwd || p4.projectPath()
1690
+ });
1691
+ if (envResult.isErr()) {
1692
+ handleError2(envResult.error);
1693
+ process25.exit(ExitCode18.FatalError);
1694
+ }
1695
+ log22.success(".env created");
1696
+ } else {
1697
+ log22.success(".env existed");
1698
+ }
1699
+ }
1697
1700
 
1698
1701
  // src/commands/test.ts
1699
1702
  import process26 from "process";
@@ -1926,4 +1929,4 @@ function version(buddy) {
1926
1929
  process30.exit(1);
1927
1930
  });
1928
1931
  }
1929
- export { build, changelog, clean, cloud2 as cloud, commit, configure, create, deploy, dev, startDevelopmentServer, domains, dns3 as dns, fresh, generate, http, lint, list, install2 as install, key, make, migrate, prepublish, release, seed, setup, optimizePkgxDeps, test, tinker, types20 as types, upgrade, version };
1932
+ export { build, changelog, clean, cloud2 as cloud, commit, configure, create, deploy, dev, startDevelopmentServer, domains, dns3 as dns, fresh, generate, http, lint, list, install2 as install, key, make, migrate, prepublish, release, seed, setup, optimizePkgxDeps, ensureEnvIsSet, test, tinker, types20 as types, upgrade, version };
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ list,
19
19
  release,
20
20
  setup,
21
21
  upgrade
22
- } from "./chunk-6658b07ce4c24cac.js";
22
+ } from "./chunk-89229d657386eb70.js";
23
23
  import {
24
24
  __commonJS,
25
25
  __toESM
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ deploy,
11
11
  dev,
12
12
  dns,
13
13
  domains,
14
+ ensureEnvIsSet,
14
15
  fresh,
15
16
  generate,
16
17
  http,
@@ -31,7 +32,7 @@ tinker,
31
32
  types,
32
33
  upgrade,
33
34
  version
34
- } from "./chunk-6658b07ce4c24cac.js";
35
+ } from "./chunk-89229d657386eb70.js";
35
36
  import"./chunk-0455e53fab4244b1.js";
36
37
  import"./chunk-59a9de11428ba763.js";
37
38
  export {
@@ -55,6 +56,7 @@ export {
55
56
  http,
56
57
  generate,
57
58
  fresh,
59
+ ensureEnvIsSet,
58
60
  domains,
59
61
  dns,
60
62
  dev,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.58.68",
4
+ "version": "0.58.69",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -132,21 +132,8 @@ async function initializeProject(options: CliOptions): Promise<void> {
132
132
  }
133
133
 
134
134
  log.success('Installed node_modules')
135
- log.info('Ensuring .env exists...')
136
-
137
- if (storage.doesNotExist(p.projectPath('.env'))) {
138
- const envResult = await runCommand('cp .env.example .env', {
139
- cwd: options.cwd || p.projectPath(),
140
- })
141
-
142
- if (envResult.isErr()) {
143
- handleError(envResult.error)
144
- process.exit(ExitCode.FatalError)
145
- }
146
135
 
147
- log.success('.env created')
148
- }
149
- else { log.success('.env existed') }
136
+ ensureEnvIsSet(options)
150
137
 
151
138
  const keyResult = await runCommand('buddy key:generate', {
152
139
  cwd: options.cwd || p.projectPath(),
@@ -179,3 +166,21 @@ async function initializeProject(options: CliOptions): Promise<void> {
179
166
  export async function optimizePkgxDeps(): Promise<void> {
180
167
  return new Promise(resolve => setTimeout(resolve, 300))
181
168
  }
169
+
170
+ export async function ensureEnvIsSet(options: CliOptions): Promise<void> {
171
+ log.info('Ensuring .env exists...')
172
+
173
+ if (storage.doesNotExist(p.projectPath('.env'))) {
174
+ const envResult = await runCommand('cp .env.example .env', {
175
+ cwd: options.cwd || p.projectPath(),
176
+ })
177
+
178
+ if (envResult.isErr()) {
179
+ handleError(envResult.error)
180
+ process.exit(ExitCode.FatalError)
181
+ }
182
+
183
+ log.success('.env created')
184
+ }
185
+ else { log.success('.env existed') }
186
+ }