File tree Expand file tree Collapse file tree 3 files changed +14
-29
lines changed Expand file tree Collapse file tree 3 files changed +14
-29
lines changed Original file line number Diff line number Diff line change 7
7
import os
8
8
import shutil
9
9
import json
10
- from env import *
10
+ from config import *
11
11
12
12
13
13
def get_login (realm , username , may_save ):
@@ -92,10 +92,22 @@ def build(project):
92
92
try :
93
93
print_log ('build project ' + project .get_name () + ' start' );
94
94
print_log (os .popen ('npm run build --prefix ' + project .get_local_code_path ()).readlines ());
95
- print_log ('build project ' + project .get_name () + ' end ' );
95
+ print_log ('build project ' + project .get_name () + ' finished ' );
96
96
except Exception ,err :
97
97
print_log ('build project ' + project_name + ' error: ' + str (err ));
98
98
99
+ def copy_to_dist (project ):
100
+ project_name = project .get_name ();
101
+ dist_dir = project .get_dist_dir ();
102
+ src_dist_dir = project .get_local_code_path () + '/dist' ;#表示源码build之后的生成目录
103
+ try :
104
+ print_log ('copy project ' + project_name + ' distribution to ' + dist_dir + ' start' );
105
+ print_log (os .popen ('rm -r ' + dist_dir ).readlines ()); #删除发布目录
106
+ print_log (os .popen ('cp -r ' + src_dist_dir + ' ' + dist_dir ).readlines ()); #拷贝源码目录中的dist至发布目录
107
+ print_log ('copy project ' + project_name + ' distribution to ' + dist_dir + ' finished' );
108
+ except Exception , err :
109
+ print_log ('copy project ' + project_name + ' distribution to ' + dist_dir + ' error: ' + str (err ));
110
+
99
111
100
112
def setlocale ():
101
113
language_code , encoding = locale .getdefaultlocale ()
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments