mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
phabricator: look for .arcrc in the correct location on Windows
Summary: On Windows `arc install-certificate` writes the cert to APPDATA: https://fburl.com/i7fpssf8, so that is where we need to look for it. Test Plan: - make this change, see that `hg ssl` shows commit status locally Reviewers: davidsp, andrasbelo, #sourcecontrol Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4962334 Tasks: 17511545
This commit is contained in:
parent
05d97a9461
commit
b331423be1
@ -26,9 +26,14 @@ def _load_file(filename):
|
||||
raise
|
||||
|
||||
def load_for_path(path):
|
||||
homedir = os.getenv('HOME')
|
||||
# location where `arc install-certificate` writes .arcrc
|
||||
if os.name == 'nt':
|
||||
envvar = 'APPDATA'
|
||||
else:
|
||||
envvar = 'HOME'
|
||||
homedir = os.getenv(envvar)
|
||||
if not homedir:
|
||||
raise ArcConfigError('$HOME environment variable not found')
|
||||
raise ArcConfigError('$%s environment variable not found' % envvar)
|
||||
|
||||
# Use their own file as a basis
|
||||
userconfig = _load_file(os.path.join(homedir, '.arcrc')) or {}
|
||||
|
Loading…
Reference in New Issue
Block a user