Compare commits

..

No commits in common. "190f17f7e241a95f06e0e04213cc83493c957f2a" and "2798682a1d6a0c701792ba67fd00493ccdc14171" have entirely different histories.

5 changed files with 7 additions and 24 deletions

View file

@ -36,5 +36,4 @@ A feature-barren DOS clone of `ls` that hides Windows hidden files. Relies on
- `explorer.sh`: Launch explorer from WSL.
- `pwsh.sh`: Launch PowerShell Core.
- `terminal.sh`: Launch Windows Terminal.
- `userprofile.sh`: Get the Windows user profile directory (`%USERPROFILE%`).

View file

@ -1,11 +0,0 @@
alias b := build
alias i := install
build:
cargo build --release
install DIR: build
cp ./target/release/env-share "{{DIR}}/env-share"

View file

@ -7,5 +7,4 @@ install DIR="~/.bin":
cp explorer.sh {{DIR}}/explorer
cp pwsh.sh {{DIR}}/pwsh
cp terminal.sh {{DIR}}/terminal
cp userprofile.sh {{DIR}}/userprofile

View file

@ -13,7 +13,13 @@ fi
# fall back to user installation
if [ -z ${PWSH+x} ]; then
PWSH="`userprofile`/AppData/Local/Microsoft/WindowsApps/pwsh.exe"
# absolutely monstrous string hackery
# get %USERPROFILE% using cmd and convert that path
USERPROFILE=`/mnt/c/Windows/System32/cmd.exe '/C' 'echo %USERPROFILE%' 2> /dev/null`
USERPROFILE=${USERPROFILE//\\//} # replace '\' separators with '/'
USERPROFILE=/mnt/c/${USERPROFILE#C:/} # replace 'C:/' with '/mnt/c/'
USERPROFILE=${USERPROFILE%$'\r'} # strip carriage return
PWSH="$USERPROFILE/AppData/Local/Microsoft/WindowsApps/pwsh.exe"
fi
# run target

View file

@ -1,10 +0,0 @@
#!/usr/bin/bash
# absolutely monstrous string hackery
# get %USERPROFILE% using cmd and convert that path
USERPROFILE=`/mnt/c/Windows/System32/cmd.exe '/C' 'echo %USERPROFILE%' 2> /dev/null`
USERPROFILE=${USERPROFILE//\\//} # replace '\' separators with '/'
USERPROFILE=/mnt/c/${USERPROFILE#C:/} # replace 'C:/' with '/mnt/c/'
USERPROFILE=${USERPROFILE%$'\r'} # strip carriage return
echo $USERPROFILE