@@ -173,20 +173,6 @@ def run(self, argv, dependencies):
173
173
self .parse_args (argv );
174
174
self ._create_from_cmd ()
175
175
176
-
177
- # ignore files function generator
178
- def _ignorePath (root , ignore_files ):
179
- def __ignoref (p , files ):
180
- ignore_list = []
181
- for f in files :
182
- for igf in ignore_files :
183
- f1 = os .path .abspath (os .path .join (p , f ))
184
- f2 = os .path .abspath (os .path .join (root , igf ))
185
- if f1 == f2 :
186
- ignore_list .append (f )
187
- return ignore_list
188
- return __ignoref
189
-
190
176
def replace_string (filepath , src_string , dst_string ):
191
177
""" From file's content replace specified string
192
178
Arg:
@@ -309,10 +295,16 @@ def __init__(self, lang, cocos_root, project_name, project_dir, tp_name, tp_dir,
309
295
310
296
def cp_self (self , project_dir , exclude_files ):
311
297
cocos .Logging .info ('> Copy template into %s' % project_dir )
312
- src = cocos .add_path_prefix (self .tp_dir )
313
- dst = cocos .add_path_prefix (self .project_dir )
314
- shutil .copytree (src , dst , True ,
315
- ignore = _ignorePath (src , exclude_files ) )
298
+
299
+ if not os .path .exists (self .project_dir ):
300
+ os .makedirs (self .project_dir )
301
+
302
+ copy_cfg = {
303
+ "from" : self .tp_dir ,
304
+ "to" : self .project_dir ,
305
+ "exclude" : exclude_files
306
+ }
307
+ cocos .copy_files_with_config (copy_cfg , self .tp_dir , self .project_dir )
316
308
317
309
318
310
def do_default_step (self ):
0 commit comments