Skip to content

Commit 1ab0639

Browse files
committed
fix(flag support): fixed error at --no-generate flag
Co-authored-by:
1 parent afb20a2 commit 1ab0639

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

generator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from conventions.no_convention import just_message
1313

1414
# utils imports
15-
from utils import menu
1615
from utils import parser_cli
1716
from utils import create_file
1817

@@ -46,10 +45,10 @@
4645
elif args.convention is not '':
4746
convention = str(args.convention)
4847
if convention == 'angular' or convention == 'karma':
49-
angular_convention(parser.co_author)
48+
angular_convention(args.co_author)
5049
create_file(convention, args.no_file)
5150
elif convention == 'changelog':
52-
changelog_convention(parser.co_author)
51+
changelog_convention(args.co_author)
5352
create_file(convention, args.no_file)
5453
elif convention == 'symphony':
5554
symphony_convention(args.co_author)

utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def create_file(convention_name, dont_create=False):
3838
)
3939
with open('commiter.yml', 'w') as output_file:
4040
dump(data, output_file, default_flow_style=False)
41+
print('Successfully created the commiter file.')
4142

4243

4344
def parser_cli():
@@ -50,10 +51,10 @@ def parser_cli():
5051
parser = argparse.ArgumentParser(description=desc)
5152
parser.add_argument("--co-author",
5253
help="make your friend an co-author to the commit",
53-
dest="co_author", default=None)
54+
dest="co_author", default='')
5455
parser.add_argument("--no-generate", dest="no_file",
5556
help="disables the creation of a commiter.yml file",
56-
default=True, type=bool)
57+
default=False, type=bool)
5758
parser.add_argument("--convention", choices=supported_conventions,
5859
dest="convention", default='', help=help_convention)
5960
return parser

0 commit comments

Comments
 (0)