Created
September 14, 2018 07:14
-
-
Save rootbsd/d7af9123684d35fcca566e9c4a8f3593 to your computer and use it in GitHub Desktop.
Open Explorer.exe in the current WSL -Windows Subsystem for Linux- directory (Ubuntu Only but easy to adapt)
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
function pop() { | |
if [ $(pwd | sed -n -e 's!^/mnt/!!p' | wc -c) == 0 ] | |
then | |
cmd.exe /c "echo %LOCALAPPDATA%" > /tmp/LOCALAPPDATA | |
dest="$(strings -a /tmp/LOCALAPPDATA)\\Packages" | |
cmd.exe /c "dir $dest | findstr CanonicalGroupLimited" > /tmp/Canonical | |
repo=$(strings -a /tmp/Canonical | awk '{print $NF}') | |
root=$(echo "$dest\\$repo\\LocalState\\rootfs") | |
explorer.exe $(echo ${root}$(pwd | sed 's!/!\\!g')) | |
else | |
explorer.exe $(pwd | sed -e 's!/mnt/!!g' -e 's!/!\\!g' -e 's/\(.\)\(.*\)/\1:\2/g') | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment