dots/xontrib/ps1.xsh

7 lines
194 B
Text
Raw Normal View History

2022-02-18 20:42:32 +00:00
from xonsh.built_ins import XSH
@XSH.builtins.events.on_transform_command
def ps1_preproc(cmd, **kw):
if cmd.split(" ")[0].strip().endswith(".ps1"):
cmd = f"powershell.exe {cmd}"
return cmd