Skip to content

Commit

Permalink
Add giturlparse and parse remote
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljoseph committed Dec 8, 2014
1 parent 698b0b2 commit eb39606
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions changes/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from os.path import exists, join

import click
from giturlparse import parse
from plumbum.cmd import git
import yaml

CONFIG_FILE = '.changes'
Expand Down Expand Up @@ -30,8 +32,25 @@ def __init__(self, module_name, dry_run, debug, no_input, requirements,
self.current_version = current_version
self.repo_url = repo_url

self.parsed_repo = parse(git('config --get remote.origin.url'.split(' ')))

def project_config(context):
@property
def repo(self):
return self.parsed_repo.repo

@property
def owner(self):
return self.parsed_repo.owner

@property
def github(self):
return self.parsed_repo.github

@property
def bitbucket(self):
return self.parsed_repo.bitbucket

config = {}
config_path = join(context.module_name, CONFIG_FILE)

Expand Down
1 change: 1 addition & 0 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PyYAML < 4.0.0
plumbum < 1.5.0
click < 4.0.0
giturlparse.py < 0.1.0
future < 1.0.0
path.py < 5.0.0
semantic_version < 3.0.0
Expand Down

0 comments on commit eb39606

Please sign in to comment.