Skip to content

Commit

Permalink
Merge pull request #33 from F1LT3R/git_hooks_dir_check
Browse files Browse the repository at this point in the history
Wrong exception when .git/hooks directory missing
  • Loading branch information
justinabrahms committed Mar 17, 2015
2 parents 149b221 + 4dfda9e commit c49af40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sprintly
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,12 @@ class SprintlyTool:

# ensure the current directory is a git repository
directory = os.getcwd()
hooks_directory = os.path.join(directory, '.git', 'hooks')
if not os.path.isdir(hooks_directory):
git_directory = os.path.join(directory, '.git')
if not os.path.isdir(git_directory):
raise SprintlyException('This command can only be run from the root of a git repository.')

hooks_directory = os.path.join(git_directory, 'hooks')
if not os.path.isdir(hooks_directory):
raise SprintlyException('You do not appear to have a .git/hooks directory in your git repository.')
# ensure hook is installed
if not os.path.isfile(HOOK_PATH):
raise SprintlyException('Please run \'sprintly --update\' first to install the hook.')
Expand Down

0 comments on commit c49af40

Please sign in to comment.