Skip to content

Solve the error when creating project in the root of disk on windows. #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions plugins/project_new/project_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,6 @@ def run(self, argv, dependencies):
self.parse_args(argv);
self._create_from_cmd()


# ignore files function generator
def _ignorePath(root, ignore_files):
def __ignoref(p, files):
ignore_list = []
for f in files:
for igf in ignore_files:
f1 = os.path.abspath(os.path.join(p, f))
f2 = os.path.abspath(os.path.join(root, igf))
if f1 == f2:
ignore_list.append(f)
return ignore_list
return __ignoref

def replace_string(filepath, src_string, dst_string):
""" From file's content replace specified string
Arg:
Expand Down Expand Up @@ -309,10 +295,16 @@ def __init__(self, lang, cocos_root, project_name, project_dir, tp_name, tp_dir,

def cp_self(self, project_dir, exclude_files):
cocos.Logging.info('> Copy template into %s' % project_dir)
src = cocos.add_path_prefix(self.tp_dir)
dst = cocos.add_path_prefix(self.project_dir)
shutil.copytree(src, dst, True,
ignore = _ignorePath(src, exclude_files) )

if not os.path.exists(self.project_dir):
os.makedirs(self.project_dir)

copy_cfg = {
"from" : self.tp_dir,
"to" : self.project_dir,
"exclude" : exclude_files
}
cocos.copy_files_with_config(copy_cfg, self.tp_dir, self.project_dir)


def do_default_step(self):
Expand Down