Skip to content

Commit

Permalink
#16 Add git repository check
Browse files Browse the repository at this point in the history
katip was generating multiple lines of error, while running under
a directory which is not a git initiliazed directory. Control added
to check if directory is initialized as a git repostiory
  • Loading branch information
baygunm committed Jul 30, 2013
1 parent 8b22c6f commit 0d128bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#### [Current]
* [8b22c6f](../../commit/8b22c6f) Add latest change log __(Murat Kemal BAYGÜN)__
* [5fc6991](../../commit/5fc6991) #14 Update readme, add sample output __(Murat Kemal BAYGÜN)__
* [3f7788c](../../commit/3f7788c) #14 update README.md __(Onur Ozgur OZKAN)__

Expand Down
15 changes: 13 additions & 2 deletions bin/katip
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

REPO_URL='../../commit/'

def git_repository?
initialized = `git rev-parse --is-inside-work-tree`.chomp

if initialized != 'true'
initialized = false
puts 'Exiting. Nothing to create log file.'
end
initialized
end

def write_file(output)

file_name='CHANGELOG.md'
Expand Down Expand Up @@ -53,6 +63,7 @@ def parse_change_log
output
end

write_file parse_change_log

if git_repository?
write_file parse_change_log
end

0 comments on commit 0d128bd

Please sign in to comment.