Skip to content

Commit

Permalink
0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
a committed Oct 9, 2020
1 parent 5dddef5 commit d6d7658
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='xontrib-sh',
version='0.0.2',
version='0.0.3',
license='BSD',
author='anki',
author_email='[email protected]',
Expand Down
10 changes: 5 additions & 5 deletions xontrib/sh.xsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from shutil import which

_shells = ['bash', 'zsh', 'fish']
_shells = ['bash', 'zsh', 'fish', 'sh']
_installed_shells = []

@events.on_transform_command
Expand All @@ -13,13 +13,13 @@ def onepath(cmd, **kw):

cmd = cmd[1:].strip()

shells = []
first_compatible_shell = None
for s in _installed_shells:
if $(@(s) -nc @(cmd) 2>&1).strip() == '':
shells.append(s)
first_compatible_shell = s
break

if shells:
first_compatible_shell = shells[0]
if first_compatible_shell:
shell_cmd = first_compatible_shell + ' -c'
printx(f'{{BOLD_WHITE}}{first_compatible_shell}:{{RESET}}\n\r', end='')
else:
Expand Down

0 comments on commit d6d7658

Please sign in to comment.