rename env to runenv
This commit is contained in:
		
							parent
							
								
									1c6e2b7f96
								
							
						
					
					
						commit
						15fb9fd328
					
				
							
								
								
									
										6
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								index.js
									
									
									
									
									
								
							| @ -44,10 +44,10 @@ module.exports = function (rawConfig) { | |||||||
|     for (let [key, param, desc] of global.SysConfig.commanderOptions || []) { |     for (let [key, param, desc] of global.SysConfig.commanderOptions || []) { | ||||||
|       commander.option(param, `${desc} Default = "${global.SysConfig[key]}"`) |       commander.option(param, `${desc} Default = "${global.SysConfig[key]}"`) | ||||||
|     } |     } | ||||||
|     commander.parse(process.argv).parse(process.argv) |     commander.parse(process.argv) | ||||||
| 
 | 
 | ||||||
|     global.SysConfig.env = commander.env || global.SysConfig.env || process.env.NODE_ENV || 'development' // server = require('express')(); server.get('env) === server.settings.env === process.env.NODE_ENV
 |     global.SysConfig.runenv = commander.runenv || global.SysConfig.runenv || process.env.NODE_ENV || 'development' // server = require('express')(); server.get('env) === server.settings.env === process.env.NODE_ENV
 | ||||||
|     if (global.SysConfig.env === 'production' && global.SysConfig.production) { |     if (global.SysConfig.runenv === 'production' && global.SysConfig.production) { | ||||||
|       console.info('- Loading Production Configuration (加载生产环境配置)') |       console.info('- Loading Production Configuration (加载生产环境配置)') | ||||||
|       global.SysConfig = deepmerge(global.SysConfig, global.SysConfig.production) |       global.SysConfig = deepmerge(global.SysConfig, global.SysConfig.production) | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user