mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
Separate .tito directory creation from tito.props file creation
Fix #158 As a consequence we can easily print a different message when running `tito init' an already initialized tito project.
This commit is contained in:
parent
e3173db770
commit
3e5450a533
1 changed files with 6 additions and 5 deletions
|
@ -698,14 +698,15 @@ class InitModule(BaseCliModule):
|
|||
should_commit = False
|
||||
|
||||
rel_eng_dir = os.path.join(find_git_root(), '.tito')
|
||||
if not os.path.exists(rel_eng_dir):
|
||||
print("Creating tito metadata in: %s" % rel_eng_dir)
|
||||
os.makedirs(rel_eng_dir)
|
||||
print(" - created %s" % rel_eng_dir)
|
||||
else:
|
||||
print("Reinitializing existing tito metadata in %s" % rel_eng_dir)
|
||||
|
||||
propsfile = os.path.join(rel_eng_dir, TITO_PROPS)
|
||||
if not os.path.exists(propsfile):
|
||||
if not os.path.exists(rel_eng_dir):
|
||||
os.makedirs(rel_eng_dir)
|
||||
print(" - created %s" % rel_eng_dir)
|
||||
|
||||
# write out tito.props
|
||||
out_f = open(propsfile, 'w')
|
||||
out_f.write("[buildconfig]\n")
|
||||
|
|
Loading…
Add table
Reference in a new issue