n-vz 1.1.13 → 1.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n-vz",
3
- "version": "1.1.13",
3
+ "version": "1.1.16",
4
4
  "description": "neat vue zero",
5
5
  "main": "index.js",
6
6
  "scripts": {},
package/publish.js ADDED
@@ -0,0 +1,26 @@
1
+ const package = require('./package.json');
2
+ const fs = require('fs/promises');
3
+
4
+
5
+ const updateVersion = async path=>{
6
+ let res = await fs.readFile(path).catch(e=> (console.log(e),'__error'));
7
+ if(res === '__error') return;
8
+ res = res.toString().replaceAll('###n-vz:version###',package.version);
9
+ res = await fs.writeFile(path, res ).catch(e=> (console.log(e),'__error'));
10
+ if(res === '__error') return;
11
+
12
+ return 1;
13
+ }
14
+
15
+
16
+ !(async ()=>{
17
+ let res = await updateVersion('./index.js')
18
+ if(!res) return console.log('update version error')
19
+ res = await updateVersion('./el.js')
20
+ if(!res) return console.log('update version error')
21
+ res = await updateVersion('./small.js')
22
+ if(!res) return console.log('update version error')
23
+ res = await updateVersion('./mini.js')
24
+ if(!res) return console.log('update version error')
25
+ console.log('update version success')
26
+ })();