parent
eb388306fd
commit
6f69c01915
@ -31,6 +31,8 @@
|
|||||||
import spack
|
import spack
|
||||||
from spack.util.executable import which
|
from spack.util.executable import which
|
||||||
|
|
||||||
|
_SPACK_UPSTREAM = 'https://github.com/llnl/spack'
|
||||||
|
|
||||||
description = "Create a new installation of spack in another prefix"
|
description = "Create a new installation of spack in another prefix"
|
||||||
|
|
||||||
def setup_parser(subparser):
|
def setup_parser(subparser):
|
||||||
@ -40,9 +42,15 @@ def setup_parser(subparser):
|
|||||||
def get_origin_url():
|
def get_origin_url():
|
||||||
git_dir = join_path(spack.prefix, '.git')
|
git_dir = join_path(spack.prefix, '.git')
|
||||||
git = which('git', required=True)
|
git = which('git', required=True)
|
||||||
|
try:
|
||||||
origin_url = git(
|
origin_url = git(
|
||||||
'--git-dir=%s' % git_dir, 'config', '--get', 'remote.origin.url',
|
'--git-dir=%s' % git_dir,
|
||||||
|
'config', '--get', 'remote.origin.url',
|
||||||
output=str)
|
output=str)
|
||||||
|
except ProcessError:
|
||||||
|
origin_url = _SPACK_UPSTREAM
|
||||||
|
tty.warn('No git repository found; '
|
||||||
|
'using default upstream URL: %s' % origin_url)
|
||||||
return origin_url.strip()
|
return origin_url.strip()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user