aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sh/wsl.sh
blob: 4a876df80e580e6928b2b9acadb0df71f8b96958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export EDITOR=code

alias cb=clip.exe
alias wsl=wsl.exe
alias ykman="/mnt/c/Program\ Files/Yubico/YubiKey\ Manager/ykman.exe"

function wt() { powershell.exe -NoProfile -c "wt $@" }

function winget() {
  cmd="winget.exe $1"
  shift # past cmd

  while [[ $# -gt 0 ]]
  do
    key="$1"
    case $key in
        -*) # key value pair
        cmd+=" $key '$2'"
        shift # past argument
        shift # past value
        ;;
        *)    # positional argument
        cmd+=" '$1'" # add it to the list
        shift # past argument
        ;;
    esac
  done
  
  powershell.exe -NoProfile -c "$cmd"
}