@globules-io/ogx.js 1.8.6 → 1.8.7
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.
- package/install.js +18 -1
- package/package.json +2 -1
package/install.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
1
2
|
const path = require('path');
|
|
2
3
|
const copy = require('recursive-copy');
|
|
3
4
|
const src_www = path.normalize(__dirname+'/www');
|
|
4
5
|
const dest_www = path.normalize(__dirname+'./../../../www');
|
|
5
6
|
const src_ogx = path.normalize(__dirname+'/ogx');
|
|
6
7
|
const dest_ogx = path.normalize(__dirname+'./../../../ogx');
|
|
8
|
+
let index_exists = fs.existsSync(dest_www+'/index.html');
|
|
9
|
+
let app_exists = fs.existsSync(dest_www+'/app.json');
|
|
10
|
+
if(index_exists){
|
|
11
|
+
fs.renameSync(dest_www+'/index.html', dest_www+'/index.bak');
|
|
12
|
+
}
|
|
13
|
+
if(app_exists){
|
|
14
|
+
fs.renameSync(dest_www+'/app.json', dest_www+'/app.bak');
|
|
15
|
+
}
|
|
7
16
|
copy(src_www, dest_www, {overwrite:true});
|
|
8
|
-
copy(src_ogx, dest_ogx, {overwrite:true});
|
|
17
|
+
copy(src_ogx, dest_ogx, {overwrite:true});
|
|
18
|
+
if(index_exists){
|
|
19
|
+
fs.unlinkSync(dest_www+'/index.html');
|
|
20
|
+
fs.renameSync(dest_www+'/index.bak', dest_www+'/index.html');
|
|
21
|
+
}
|
|
22
|
+
if(app_exists){
|
|
23
|
+
fs.unlinkSync(dest_www+'/app.json');
|
|
24
|
+
fs.renameSync(dest_www+'/app.bak', dest_www+'/app.json');
|
|
25
|
+
}
|
package/package.json
CHANGED