Created
February 19, 2020 17:21
-
-
Save SirJson/525ac5d9a2845638ab0f7ae94feaf91d to your computer and use it in GitHub Desktop.
A WSL replacement for xdg-open
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -f /proc/version ]] && grep -Pq '[Mm]?icrosoft' /proc/version; then | |
echo "Only works with WSL" | |
exit 1 | |
fi | |
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Start-Process -FilePath "$@" -Verb open |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment