mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-15 18:16:13 +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:
|
elif project:
|
||||||
if not os.path.exists(project):
|
if not os.path.exists(project):
|
||||||
|
if meta_exists(metatype='prj', path_args=quote_plus(project), create_new=False):
|
||||||
init_project_dir(conf.config['apiurl'], project, project)
|
init_project_dir(conf.config['apiurl'], project, project)
|
||||||
print statfrmt('A', project)
|
print statfrmt('A', project)
|
||||||
|
else:
|
||||||
|
print >>sys.stderr, 'osc: project \'%s\' does not exist on the server' % project
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print >>sys.stderr, 'osc: project \'%s\' already exists' % project
|
print >>sys.stderr, 'osc: project \'%s\' already exists' % project
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user