esoftplay 0.0.151 → 0.0.152

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 +9 -1
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -287,7 +287,15 @@ function switchStatusAssets(status) {
287
287
  if (fs.existsSync(from)) {
288
288
  if (fs.existsSync(to))
289
289
  command('rm ' + to)
290
- command('cp ' + from + ' ' + to)
290
+ const oldscript = fs.readFileSync(from, 'utf8')
291
+ const data = oldscript.match(new RegExp(/^\/\/\s{0,}export\s{1}default/gm))
292
+ let newData = data;
293
+ if (data && data.length > 0) {
294
+ newData = oldscript.replace((new RegExp(/^\/\//gm)), "")
295
+ fs.writeFileSync(to, newData)
296
+ } else {
297
+ command('cp ' + from + ' ' + to)
298
+ }
291
299
  }
292
300
  }
293
301
  fs.readdirSync(DIR).forEach((file) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.151",
3
+ "version": "0.0.152",
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",