def archive(env):
print('Archiving LOVE project \'%s\'...' % env.conf.identifier)
# Archives the project directory into a .love file
if not os.path.exists(env.dist_dir):
os.makedirs(env.dist_dir)
# Creates the .zip file
tmp_dir = tempfile.mkdtemp()
copytree(env.project_dir, tmp_dir, ignore=ignored_files)
shutil.make_archive(env.love_file, 'zip', tmp_dir)
shutil.rmtree(tmp_dir)
# Renames to .love, since shutil.make_archive() adds .zip
os.rename(env.love_file + '.zip', env.love_file)
print('Archival complete!')
评论列表
文章目录