mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Merge branch 'fix-bash-aliases' of https://github.com/auscompgeek/xonsh into foreignsh
This commit is contained in:
commit
fa54a2abbc
1 changed files with 2 additions and 3 deletions
|
@ -104,13 +104,12 @@ def bang_bang(args, stdin=None):
|
|||
def bash_aliases():
|
||||
"""Computes a dictionary of aliases based on Bash's aliases."""
|
||||
try:
|
||||
s = subprocess.check_output(['bash', '-i', '-l'],
|
||||
input='alias',
|
||||
s = subprocess.check_output(['bash', '-i', '-c', 'alias'],
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||
s = ''
|
||||
items = [line.split('=', 1) for line in s.splitlines() if '=' in line]
|
||||
items = [line.split('=', 1) for line in s.splitlines() if line.startswith('alias ') and '=' in line]
|
||||
aliases = {}
|
||||
for key, value in items:
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue