mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
make rc files be run in __xonsh_ctx__ directly
This commit is contained in:
parent
2db0912c9b
commit
a46e0569c2
1 changed files with 6 additions and 3 deletions
|
@ -1272,12 +1272,15 @@ def load_static_config(ctx, config=None):
|
|||
return conf
|
||||
|
||||
|
||||
def xonshrc_context(rcfiles=None, execer=None):
|
||||
def xonshrc_context(rcfiles=None, execer=None, initial=None):
|
||||
"""Attempts to read in xonshrc file, and return the contents."""
|
||||
loaded = builtins.__xonsh_env__['LOADED_RC_FILES'] = []
|
||||
if rcfiles is None or execer is None:
|
||||
return {}
|
||||
if initial is None:
|
||||
env = {}
|
||||
else:
|
||||
env = initial
|
||||
if rcfiles is None or execer is None:
|
||||
return env
|
||||
for rcfile in rcfiles:
|
||||
if not os.path.isfile(rcfile):
|
||||
loaded.append(False)
|
||||
|
|
Loading…
Add table
Reference in a new issue