Skip to content

Instantly share code, notes, and snippets.

@shunshunNi
Created September 6, 2022 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shunshunNi/18bb4a851e6ad12301b5a099b435b312 to your computer and use it in GitHub Desktop.
Save shunshunNi/18bb4a851e6ad12301b5a099b435b312 to your computer and use it in GitHub Desktop.
function open
if test (count $argv) -eq 0
explorer.exe .
else
if test -f $argv[1]
cmd.exe /c start (wslpath -w $argv[1]) 2> /dev/null
else if test -d $argv[1]
explorer.exe (wslpath -w $argv[1])
else
echo "open: $1 : No such file or directory"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment