algocoach 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/cli/index.ts +11 -9
  2. package/package.json +1 -1
package/cli/index.ts CHANGED
@@ -86,23 +86,25 @@ async function cmdStart() {
86
86
  process.env.LOCAL_DEV = "true"
87
87
  process.env.LOCAL_USER_ID = "local-user"
88
88
  process.env.BETTER_AUTH_SECRET = "local-dev-secret-min-32-chars-long-for-better-auth"
89
+ process.env.BETTER_AUTH_URL = `http://localhost:${preferredPort}`
90
+ process.env.CORS_ORIGIN = `http://localhost:${preferredPort}`
89
91
 
90
92
  const { serve } = await import("../server/index")
91
93
  const { port } = serve(preferredPort)
92
94
 
93
- process.env.BETTER_AUTH_URL = `http://localhost:${port}`
94
- process.env.CORS_ORIGIN = `http://localhost:${port}`
95
-
96
95
  const url = `http://localhost:${port}`
96
+
97
97
  console.log(`\n AlgoCoach running at ${url}\n`)
98
98
 
99
99
  // Auto-open browser
100
- const openCmd = process.platform === "darwin"
101
- ? ["open", url]
102
- : process.platform === "win32"
103
- ? ["cmd", "/c", "start", url]
104
- : ["xdg-open", url]
105
- Bun.spawn(openCmd).unwrap().catch(() => {})
100
+ try {
101
+ const openCmd = process.platform === "darwin"
102
+ ? ["open", url]
103
+ : process.platform === "win32"
104
+ ? ["cmd", "/c", "start", url]
105
+ : ["xdg-open", url]
106
+ Bun.spawnSync(openCmd)
107
+ } catch {}
106
108
  }
107
109
 
108
110
  const cmd = process.argv[2] || "start"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "algocoach",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "algocoach": "cli/index.ts"