File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from shutil import which
4
4
5
- _shells = list (__xonsh__ .env .get ('XONTRIB_SH_SHELLS' , ['bash' , 'sh' ]))
5
+ def parse_shells_env (shells_env ):
6
+ if isinstance (shells_env , str ):
7
+ if '[' in shells_env : # string representation of a list
8
+ return shells_env .strip ('[]' ).replace ("'" , "" ).split (',' )
9
+ return [shells_env .replace ("'" , "" )] #single shell
10
+ return list (shells_env )
11
+
12
+ _shells = parse_shells_env (__xonsh__ .env .get ('XONTRIB_SH_SHELLS' , ['bash' , 'sh' ]))
6
13
_bash_win = 'bash.exe'
7
14
_installed_shells = []
8
15
_match_first_char = __xonsh__ .env .get ('XONTRIB_SH_MATCHFIRST' , True )
9
16
_match_full_name = __xonsh__ .env .get ('XONTRIB_SH_MATCHFULL' , True )
10
17
_shells_without_syntax_check = ['pwsh' , 'powershell' , 'cmd' , 'nu' ]
11
18
12
-
13
19
@events .on_transform_command
14
20
def onepath (cmd , ** kw ):
15
21
cmd_flag = '-c' # *sh flag to execute the specified commands, change to '/C' for cmd
You can’t perform that action at this time.
0 commit comments