File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change
1
+ set SQUICK_RUN_ENV = ten
Original file line number Diff line number Diff line change 10
10
11
11
print ('Gen env: ' + env )
12
12
13
- package_list = {}
14
13
tmpl_path = '../config/tmpl'
15
14
tmpl_value_path = '../config/tmpl/env'
16
15
cfg_path = '../config/node'
17
16
18
17
cfg_map = {}
19
- cfg_value_map = {}
18
+ conf_content = ''
20
19
21
20
def GetFileContent (path ):
22
21
fd = open (path , 'r' )
@@ -29,13 +28,13 @@ def GetFileContent(path):
29
28
cfg_map [f ] = GetFileContent (tmpl_path + '/' + f )
30
29
elif f .endswith ('.conf' ):
31
30
print ("conf file: " , f )
32
- cfg_value_map [f ] = GetFileContent (tmpl_path + '/env/' + f )
31
+ if f == env + '.conf' :
32
+ conf_content = GetFileContent (tmpl_path + '/env/' + f )
33
33
34
34
35
35
# replace
36
- for k in cfg_value_map :
37
- conf_file = cfg_value_map [k ]
38
- conf_arr = conf_file .split ('\n ' )
36
+ if (len (conf_content ) > 0 ):
37
+ conf_arr = conf_content .split ('\n ' )
39
38
for conf_line in conf_arr :
40
39
conf = conf_line .split ('=' )
41
40
if len (conf ) < 2 :
@@ -46,6 +45,9 @@ def GetFileContent(path):
46
45
tmp = cfg_map [k2 ]
47
46
tmp = tmp .replace ('{' + key + '}' , value )
48
47
cfg_map [k2 ] = tmp
48
+ else :
49
+ print ("Get " + env + " error" )
50
+ exit (- 1 )
49
51
50
52
# save
51
53
for k in cfg_map :
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ rem Date : 2022-11-27
5
5
rem Github: https://github.com/pwnsky/squick
6
6
rem Description: Start all servers script
7
7
8
+ call env.bat
9
+ python gen_env_config.py %SQUICK_RUN_ENV%
10
+
8
11
cd ..\bin
9
12
10
13
start /b .\squick
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ rem Date : 2024-04-08
5
5
rem Github: https://github.com/pwnsky/squick
6
6
rem Description: Start all nodes
7
7
8
+ call env.bat
9
+ python gen_env_config.py %SQUICK_RUN_ENV%
10
+
8
11
cd ..\bin
9
12
10
13
start cmd /c " squick type=master id=1 area=0 ip=127.0.0.1 port=10001 web_port=50000"
You can’t perform that action at this time.
0 commit comments