def do_command_generate(self, args):
target_location = str(os.path.join(os.getcwd(), 'config.json'))
if os.path.isfile(target_location):
self.logger.error('config file already exist in current directory.')
exit(1)
content = pkg_resources.resource_string(__name__, 'template_config.json').decode('utf-8')
file = open(target_location, 'w')
file.write(content)
file.close()
self.logger.info('empty config file generated at {}'.format(target_location))
评论列表
文章目录