From 5fb93a3d3e6efc5a39afdc34d42e58e644c3ee18 Mon Sep 17 00:00:00 2001 From: "Florian RICHER (MrDev023)" Date: Wed, 27 Oct 2021 22:07:57 +0200 Subject: [PATCH] [WINDOWS] Autoconfig WSL --- install.ps1 | 14 +++++++++++++- .../install_scripts => install_scripts}/ubuntu.sh | 0 .../cleanup_wsl_mem.sh | 0 3 files changed, 13 insertions(+), 1 deletion(-) rename {linux/install_scripts => install_scripts}/ubuntu.sh (100%) rename {linux/useful_scripts => useful_scripts}/cleanup_wsl_mem.sh (100%) diff --git a/install.ps1 b/install.ps1 index 69c914e..2b2769d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -48,4 +48,16 @@ Set-PSReadLineOption @PSReadLineOptions '@ | Out-File -FilePath $PROFILE -Append # Reload profile -. $PROFILE \ No newline at end of file +. $PROFILE + +# Configure WSL +Get-Command wsl +if ($? -eq $True) { + $linuxWindowsConfPath = (Get-Location).Path.Replace('C:', '/mnt/c').Replace('\', '/') + $linuxHomeConfPath = "/home/$(wsl -e 'whoami')/myconf" + + bash -c "ln -s $linuxWindowsConfPath $linuxHomeConfPath" + bash -c "$linuxHomeConfPath/install.sh" +} else { + Write-Output 'WSL is not installed. Ignore...' +} \ No newline at end of file diff --git a/linux/install_scripts/ubuntu.sh b/install_scripts/ubuntu.sh similarity index 100% rename from linux/install_scripts/ubuntu.sh rename to install_scripts/ubuntu.sh diff --git a/linux/useful_scripts/cleanup_wsl_mem.sh b/useful_scripts/cleanup_wsl_mem.sh similarity index 100% rename from linux/useful_scripts/cleanup_wsl_mem.sh rename to useful_scripts/cleanup_wsl_mem.sh