Skip to content

Commit efafe5c

Browse files
authored
merge(#10): after convention choice, creates a file
add(feature): create file feature after convention choice
2 parents c3147e5 + 42f6fab commit efafe5c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

generator.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
from utils import changelog_convention
88
from utils import symphony_convention
99
from utils import just_message
10+
from utils import create_file
1011

1112
tag = ''
1213
tag_is_lowercase = False
1314
tag_is_uppercase = False
1415
tag_is_capitalized = False
1516
convention = ''
1617

17-
file_path = Path("commiter.yml")
18+
file_path = Path('commiter.yml')
1819

1920
if file_path.is_file():
2021
with open(str(file_path), 'r') as stream:
@@ -52,12 +53,16 @@
5253
if opt == 1:
5354
print("You're using the angular convention")
5455
angular_convention()
56+
create_file('angular')
5557
elif opt == 2:
5658
print("You're using the changelog convention")
5759
changelog_convention()
60+
create_file('changelog')
5861
elif opt == 3:
5962
print("You're using the symphony convention")
6063
symphony_convention()
64+
create_file('symphony')
6165
elif opt == 4:
6266
print("You're not using a convention")
6367
just_message()
68+
create_file('none')

utils.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from yaml import dump
23

34
possible_configurations = [
45
'tag',
@@ -57,3 +58,10 @@ def just_message():
5758
# FUTURE: implement
5859
def custom_convention():
5960
pass
61+
62+
def create_file(convention_name):
63+
data = dict(
64+
convention = convention_name
65+
)
66+
with open('commiter.yml', 'w') as output_file:
67+
dump(data, output_file, default_flow_style=False)

0 commit comments

Comments
 (0)