def handle(self, file_name=None, **options):
project_name = os.path.basename(os.getcwd())
dst = file_name is not None and file_name or DEFAULT_FILE_NAME
if os.path.exists(dst):
raise CommandError('Error: file "%s" already exists' % dst)
open(dst, 'w').write(render_to_string('cml/cml-pipelines.txt', {
'project': project_name,
'file': os.path.basename(dst).split('.')[0]
}))
self.stdout.write('"%s" written.' % os.path.join(dst))
评论列表
文章目录