esoftplay 0.0.200 → 0.0.202

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/bin/cli.js +12 -13
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -570,6 +570,10 @@ function isCustomUpdates() {
570
570
  return false
571
571
  }
572
572
 
573
+ function getConfigVersion(slug) {
574
+ return JSON.parse(fs.readFileSync('/var/www/html/ota/scripts/config_version.json', { encoding: "utf8" }))[slug]
575
+ }
576
+
573
577
  async function preload_api() {
574
578
  let out = true
575
579
  let cjson = await readToJSON(confjson)
@@ -729,13 +733,10 @@ async function publish(notes) {
729
733
  consoleSucces("START PULL OTA..")
730
734
  command('cd /var/www/html/ota && git fetch origin master && git reset --hard FETCH_HEAD && git clean -df')
731
735
  consoleSucces("END PULL OTA..")
732
-
733
- const { getCurrentVersion } = require('/var/www/html/ota/scripts/config_version')
734
- if (getCurrentVersion)
735
- if (readToJSON(confjson).updated < getCurrentVersion(ajson.expo.slug)) {
736
- consoleError('config.json is outdated, please update to continue!')
737
- return
738
- }
736
+ if ((readToJSON(confjson).updated || 0) < getConfigVersion(ajson.expo.slug)) {
737
+ consoleError('config.json is outdated, please update to continue!')
738
+ return
739
+ }
739
740
  }
740
741
  let pack = readToJSON(packjson)
741
742
  if (fs.existsSync(confjson)) {
@@ -1212,12 +1213,10 @@ function build() {
1212
1213
  command('cd /var/www/html/ota && git fetch origin master && git reset --hard FETCH_HEAD && git clean -df')
1213
1214
  consoleSucces("END PULL OTA..")
1214
1215
 
1215
- const { getCurrentVersion } = require('/var/www/html/ota/scripts/config_version')
1216
- if (getCurrentVersion)
1217
- if (readToJSON(confjson).updated < getCurrentVersion(ajson.expo.slug)) {
1218
- consoleError('config.json is outdated, please update to continue!')
1219
- return
1220
- }
1216
+ if ((readToJSON(confjson).updated || 0) < getConfigVersion(ajson.expo.slug)) {
1217
+ consoleError('config.json is outdated, please update to continue!')
1218
+ return
1219
+ }
1221
1220
  }
1222
1221
 
1223
1222
  const local = args[1] == 'local' ? ' --local' : ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.200",
3
+ "version": "0.0.202",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",