Skip to content

Commit

Permalink
#10 add output file name as optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
baygunm committed Jul 22, 2013
1 parent 695646c commit 7b5be3d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/katip
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env ruby

DEFAULT_FILE='CHANGELOG.md'
file_name='CHANGELOG.md'

def write_file(output, file_name=DEFAULT_FILE)
if ARGV.length > 0
file_name=ARGV[0]
end

def write_file(output, file_name)
begin
file = File.open(file_name, 'w')
file.puts output
Expand Down Expand Up @@ -46,6 +50,6 @@ def parse_change_log
output
end

write_file parse_change_log
write_file parse_change_log, file_name


0 comments on commit 7b5be3d

Please sign in to comment.