From c154113cfffe6447498d279e0aa4d457798a5381 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Tue, 12 Apr 2022 13:56:22 +0200 Subject: [PATCH] Add autoconfig gitui --- run_once_windows_symlink_gitui.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 run_once_windows_symlink_gitui.ps1 diff --git a/run_once_windows_symlink_gitui.ps1 b/run_once_windows_symlink_gitui.ps1 new file mode 100644 index 0000000..fb96d89 --- /dev/null +++ b/run_once_windows_symlink_gitui.ps1 @@ -0,0 +1,15 @@ +# Self-elevate the script if required +if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { + $CommandLine = "-NoExit -File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments + Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine + Exit +} + +$config_folder = "$env:USERPROFILE\.config\\gitui" +$symlink_folder = "$env:APPDATA\gitui" +if (Test-Path $symlink_folder) { + Remove-Item -Recurse $symlink_folder +} + +New-Item -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder +Start-Sleep -Seconds 5 \ No newline at end of file