Skip to content

Commit

Permalink
Merge pull request #47 from sdss/https
Browse files Browse the repository at this point in the history
Added --https command line option
  • Loading branch information
joelbrownstein committed Dec 9, 2019
2 parents 00d7c34 + adfa6f1 commit d5c848a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions python/sdss_install/application/Argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@ def sdss_install():
parser.add_argument('-x', '--external_dependencies', action='store', dest='external_dependencies',
metavar='DIR', help='Set a string of external dependency clone commands',
default=str())
parser.add_argument('-H', '--https', action='store_true', dest='https',
help='Use GitHub https instead of ssh', default=False)
return parser
12 changes: 9 additions & 3 deletions python/sdss_install/install5/Install5.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def is_type(self,type=None,github_url=None,product=None,version=None):
if type:
product = product if product else self.options.product
version = version if version else self.options.product_version
github_url = github_url if github_url else 'git@github.com:sdss'
github_url = (github_url if github_url
else 'https://github.com/sdss' if self.options.https
else 'git@github.com:sdss')
url = join(github_url,product + '.git')
options = {'repository' : '--heads', # for validating product
'branch' : '--heads', # for validating product_version
Expand Down Expand Up @@ -276,10 +278,14 @@ def is_type(self,type=None,github_url=None,product=None,version=None):

def set_sdss_github_remote_url(self):
'''Set the SDSS GitHub HTTPS remote URL'''
self.github_remote_url = None
if self.ready:
product = self.options.product if self.options else None
self.github_remote_url = ('git@github.com:sdss/%s.git' % product
if product else None)
if product:
self.github_remote_url = ('https://github.com/sdss/{!s}.git'.format(product)
if self.options.https else
'git@github.com:sdss/{!s}.git'.format(product)
)

def fetch(self):
'''
Expand Down

0 comments on commit d5c848a

Please sign in to comment.