@nocobase/cli 1.3.2-beta → 1.3.3-beta

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 +4 -4
  2. package/src/util.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "1.3.2-beta",
3
+ "version": "1.3.3-beta",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./src/index.js",
@@ -8,7 +8,7 @@
8
8
  "nocobase": "./bin/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@nocobase/app": "1.3.2-beta",
11
+ "@nocobase/app": "1.3.3-beta",
12
12
  "@types/fs-extra": "^11.0.1",
13
13
  "@umijs/utils": "3.5.20",
14
14
  "chalk": "^4.1.1",
@@ -25,12 +25,12 @@
25
25
  "tsx": "^4.6.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@nocobase/devtools": "1.3.2-beta"
28
+ "@nocobase/devtools": "1.3.3-beta"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
32
32
  "url": "git+https://github.com/nocobase/nocobase.git",
33
33
  "directory": "packages/core/cli"
34
34
  },
35
- "gitHead": "7a411e2dec764d9d7800dc4eaae26b5ce0b1c751"
35
+ "gitHead": "cfe7de189999f40917211959cd7dd3b120820edc"
36
36
  }
package/src/util.js CHANGED
@@ -313,7 +313,7 @@ function areTimeZonesEqual(timeZone1, timeZone2) {
313
313
  }
314
314
  timeZone1 = getTimezonesByOffset(timeZone1);
315
315
  timeZone2 = getTimezonesByOffset(timeZone2);
316
- return moment.tz(timeZone1).format() === moment.tz(timeZone2).format();
316
+ return moment.tz(timeZone1).format('Z') === moment.tz(timeZone2).format('Z');
317
317
  }
318
318
 
319
319
  exports.initEnv = function initEnv() {
@@ -406,6 +406,10 @@ exports.initEnv = function initEnv() {
406
406
  process.env.DB_TIMEZONE = process.env.TZ;
407
407
  }
408
408
 
409
+ if (!/^[+-]\d{1,2}:\d{2}$/.test(process.env.DB_TIMEZONE)) {
410
+ process.env.DB_TIMEZONE = moment.tz(process.env.DB_TIMEZONE).format('Z');
411
+ }
412
+
409
413
  if (!areTimeZonesEqual(process.env.DB_TIMEZONE, process.env.TZ)) {
410
414
  throw new Error(
411
415
  `process.env.DB_TIMEZONE="${process.env.DB_TIMEZONE}" and process.env.TZ="${process.env.TZ}" are different`,