Skip to content

Commit

Permalink
add support for windows system-wide xonshrc
Browse files Browse the repository at this point in the history
pypa/pip had a similar conversation about this a few years ago
(see: pypa/pip#309) and determined that
placing global configuration files in `%ALLUSERSPROFILE%\Application
Data` was the best solution without messing around with the registry.
Following their lead on this, specifically from
pypa/pip@2b5029c5
  • Loading branch information
gforsyth committed Oct 21, 2015
1 parent 6383654 commit 67a2e92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xonsh/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def xonshconfig(env):
'XDG_CONFIG_HOME': os.path.expanduser(os.path.join('~', '.config')),
'XDG_DATA_HOME': os.path.expanduser(os.path.join('~', '.local', 'share')),
'XONSHCONFIG': xonshconfig,
'XONSHRC': (os.path.expanduser('~/.xonshrc'),'/etc/xonshrc') if ON_LINUX \
'XONSHRC': (os.path.expanduser('~/.xonshrc'),\
os.path.join(os.environ['ALLUSERSPROFILE'], 'Application Data', 'xonsh', 'xonshrc'))\
if ON_WINDOWS\
else (os.path.expanduser('~/.xonshrc'),'/etc/xonshrc'),
'XONSH_CONFIG_DIR': xonsh_config_dir,
'XONSH_DATA_DIR': xonsh_data_dir,
Expand Down

0 comments on commit 67a2e92

Please sign in to comment.