aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/wsl.install
blob: 7d3ae5260c4535486dba8d94f1cb252f67624406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

mkln ./ssh/config ~/win/.ssh/config
mkln ./gitconfig ~/win/.gitconfig
mkln ./gnupg/gpg.conf ~/win/AppData/Roaming/gnupg/gpg.conf
mkln ./gnupg/gpg-agent.conf ~/win/AppData/Roaming/gnupg/gpg-agent.conf
mkln ./gnupg/scdaemon.conf ~/win/AppData/Roaming/gnupg/scdaemon.conf
show-warnings

mkln() {
    source=$(wslpath -w $1)
    target=$(wslpath -w $(dirname $2))\\$(basename $2)
    cmd.exe /c "mklink $target $source"
}

show-warning() {
    printf "In order to use gpg with git for windows (and still share gitconfigs), you need to run\n"
    printf "\tgit.exe config --system gpg.program '%s' \n" "$(wslpath -w "$(command -v gpg.exe)")"
    printf "from an admin terminal"
}