@take-out/scripts 0.0.88 → 0.0.90

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/package.json +1 -1
  2. package/src/env-update.ts +13 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "type": "module",
5
5
  "main": "./src/run.ts",
6
6
  "sideEffects": false,
package/src/env-update.ts CHANGED
@@ -62,13 +62,20 @@ function updateDeployYml() {
62
62
  }
63
63
 
64
64
  function updateEnvServerTs() {
65
- const envServerPath = 'src/server/env-server.ts'
66
-
65
+ const candidates = ['src/constants/env-server.ts', 'src/server/env-server.ts']
66
+ let envServerPath = ''
67
67
  let envServer = ''
68
- try {
69
- envServer = readFileSync(envServerPath, 'utf-8')
70
- } catch (_error) {
71
- throw new Error(`File ${envServerPath} not found`)
68
+
69
+ for (const path of candidates) {
70
+ try {
71
+ envServer = readFileSync(path, 'utf-8')
72
+ envServerPath = path
73
+ break
74
+ } catch {}
75
+ }
76
+
77
+ if (!envServerPath) {
78
+ throw new Error(`env-server.ts not found at ${candidates.join(' or ')}`)
72
79
  }
73
80
 
74
81
  if (!envServer.includes(jsStartMarker) || !envServer.includes(jsEndMarker)) {