def upgrade(theme):
"""
upgrade the theme
"""
run_in_root(os.getcwd())
theme_path = os.path.join(os.getcwd(), 'theme/%s' % theme)
templates_path = os.path.join(theme_path, 'templates')
templates_target_path = os.path.join(os.getcwd(), 'templates')
static_path = os.path.join(theme_path, 'static')
static_target_path = os.path.join(os.getcwd(), 'static')
shutil.rmtree(templates_target_path)
shutil.rmtree(static_target_path)
shutil.copytree(templates_path, templates_target_path)
shutil.copytree(static_path, static_target_path)
logger.info('''
\033[33m{info}\033[0m
==> upgrade the theme!
'''
)
评论列表
文章目录