mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 18:26:15 +01:00
- check if a project exists before initializing the project dir
This commit is contained in:
parent
2e263514f8
commit
f8b5963c7a
@ -699,8 +699,12 @@ class Osc(cmdln.Cmdln):
|
||||
|
||||
elif project:
|
||||
if not os.path.exists(project):
|
||||
init_project_dir(conf.config['apiurl'], project, project)
|
||||
print statfrmt('A', project)
|
||||
if meta_exists(metatype='prj', path_args=quote_plus(project), create_new=False):
|
||||
init_project_dir(conf.config['apiurl'], project, project)
|
||||
print statfrmt('A', project)
|
||||
else:
|
||||
print >>sys.stderr, 'osc: project \'%s\' does not exist on the server' % project
|
||||
sys.exit(1)
|
||||
else:
|
||||
print >>sys.stderr, 'osc: project \'%s\' already exists' % project
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user