Created
March 22, 2022 05:38
-
-
Save rgbatty/789fa006046d8116eb4cbb4c346c58a3 to your computer and use it in GitHub Desktop.
Obsidian WSL Linking
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 | |
echo "Starting Windows configuration" | |
WIN_USERPATH=$(wslpath $(wslvar USERPROFILE)) | |
WIN_OBSIDIAN=$WIN_USERPATH/Documents/obsidian | |
WIN_VAULTSDIR=$WIN_OBSIDIAN/vaults | |
WSL_OBSIDIAN=~/obsidian | |
if [ ! -d "$WIN_VAULTSDIR" ]; then | |
echo "Creating $WIN_VAULTSDIR" | |
mkdir -p $WIN_VAULTSDIR | |
fi | |
if [ ! -L $WSL_OBSIDIAN ]; then | |
echo "Symlinking $WIN_OBSIDIAN to $WSL_OBSIDIAN" | |
ln -s "$WIN_OBSIDIAN" "$WSL_OBSIDIAN" | |
fi | |
echo "Windows configuration finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment