File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 77from utils import changelog_convention
88from utils import symphony_convention
99from utils import just_message
10+ from utils import create_file
1011
1112tag = ''
1213tag_is_lowercase = False
1314tag_is_uppercase = False
1415tag_is_capitalized = False
1516convention = ''
1617
17- file_path = Path (" commiter.yml" )
18+ file_path = Path (' commiter.yml' )
1819
1920if file_path .is_file ():
2021 with open (str (file_path ), 'r' ) as stream :
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' )
Original file line number Diff line number Diff line change 11import os
2+ from yaml import dump
23
34possible_configurations = [
45 'tag' ,
@@ -57,3 +58,10 @@ def just_message():
5758# FUTURE: implement
5859def 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 )
You can’t perform that action at this time.
0 commit comments