Add autoconfig gitui
This commit is contained in:
parent
f729ee8bb7
commit
c154113cff
1 changed files with 15 additions and 0 deletions
15
run_once_windows_symlink_gitui.ps1
Normal file
15
run_once_windows_symlink_gitui.ps1
Normal file
|
@ -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
|
Loading…
Reference in a new issue