u
This commit is contained in:
		
							parent
							
								
									80f0ceb906
								
							
						
					
					
						commit
						4aa5a23864
					
				| @ -3,7 +3,7 @@ const fs = require('fs') | |||||||
| 
 | 
 | ||||||
| // 读取 manifest.json ,修改后重新写入
 | // 读取 manifest.json ,修改后重新写入
 | ||||||
| // https://uniapp.dcloud.net.cn/collocation/vue-config.html
 | // https://uniapp.dcloud.net.cn/collocation/vue-config.html
 | ||||||
| const manifestPath = path.join(__dirname, 'manifest.json') | const manifestPath = path.resolve('manifest.json') | ||||||
| let Manifest = fs.readFileSync(manifestPath, { encoding: 'utf-8' }) | let Manifest = fs.readFileSync(manifestPath, { encoding: 'utf-8' }) | ||||||
| function replaceManifest (path, value) { | function replaceManifest (path, value) { | ||||||
|   const arr = path.split('.') |   const arr = path.split('.') | ||||||
| @ -18,7 +18,7 @@ function replaceManifest (path, value) { | |||||||
|       const hasComma = /,/.test(item) |       const hasComma = /,/.test(item) | ||||||
|       ManifestArr[index] = item.replace( |       ManifestArr[index] = item.replace( | ||||||
|         new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), |         new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), | ||||||
|         `"${lastItem}" : ${value}${hasComma ? ',' : ''}` |         `"${lastItem}": ${value}${hasComma ? ',' : ''}` | ||||||
|       ) |       ) | ||||||
|       break |       break | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | { | ||||||
|  |   "name": "wo_scripts", | ||||||
|  |   "version": "1.0.0", | ||||||
|  |   "description": "", | ||||||
|  |   "main": "app_versioning.js", | ||||||
|  |   "scripts": { | ||||||
|  |     "test": "echo \"Error: no test specified\" && exit 1" | ||||||
|  |   }, | ||||||
|  |   "repository": { | ||||||
|  |     "type": "git", | ||||||
|  |     "url": "https://git.faronear.org/npm/wo_scripts" | ||||||
|  |   }, | ||||||
|  |   "keywords": [], | ||||||
|  |   "author": "", | ||||||
|  |   "license": "ISC" | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user