Skip to content

Commit

Permalink
added error message and default action
Browse files Browse the repository at this point in the history
  • Loading branch information
lxhunter committed Aug 18, 2017
1 parent 948eb5c commit 1c4ab2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
29 changes: 14 additions & 15 deletions bin/gooh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import yaml
import sh
import os
from urlparse import urlparse
from os.path import splitext, basename, exists
from os import makedirs
Expand All @@ -15,11 +16,15 @@ def update(args):

requirements = []

with open(dependency_file, 'r') as stream:
try:
requirements = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
try:
with open(dependency_file, 'r') as stream:
try:
requirements = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
except IOError as e:
print(e)
exit(e.errno)

git = sh.git.bake(_cwd=clone_path)

Expand Down Expand Up @@ -76,25 +81,19 @@ def update(args):


parser = argparse.ArgumentParser(description='Git Out Of Hell - Language agnostic semantic versioner using git tags')
subparsers = parser.add_subparsers()

parser_update = subparsers.add_parser(
'update',
help='clones or pulls repository, sets it to the proper version (if specified)'
)
parser_update.add_argument(
parser.add_argument(
'--dependency_file',
default='gooh.yml',
help='Config yaml which holds all dependencies\n (default=gooh.yml)'
)
parser_update.add_argument(

parser.add_argument(
'--clone_path',
default='roles',
help='Path where the dependencies should be cloned (default=roles)'
)
parser_update.set_defaults(func=update)

args = parser.parse_args()
args.func(args)
update(parser.parse_args())

exit(0)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from setuptools import setup

setup(name='gooh',
version='1.0.5',
version='1.0.6',
description='Language agnostic semantic versioner using git tags',
url='http://github.com/lxhunter/gooh',
download_url = 'http://github.com/lxhunter/gooh/tarball/1.0.5',
download_url = 'http://github.com/lxhunter/gooh/tarball/1.0.6',
author='Alexander Jaeger',
author_email='[email protected]',
license='MIT',
Expand Down

0 comments on commit 1c4ab2d

Please sign in to comment.