Refactoring
This commit is contained in:
parent
b2b7d78643
commit
4fab1e612a
1 changed files with 14 additions and 10 deletions
|
@ -21,16 +21,20 @@ if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
|
|||
Start-Sleep -Seconds 1
|
||||
} else {
|
||||
try {
|
||||
$appDatasToSymlink = 'gitui'
|
||||
Foreach ($item in $appDatasToSymlink) {
|
||||
$config_folder = "$env:USERPROFILE\.config\$item"
|
||||
$symlink_folder = "$env:APPDATA\$item"
|
||||
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
|
||||
}
|
||||
$localAppDatasToSymlink = 'nvim'
|
||||
Foreach ($item in $localAppDatasToSymlink) {
|
||||
$config_folder = "$env:USERPROFILE\.config\$item"
|
||||
$symlink_folder = "$env:LOCALAPPDATA\$item"
|
||||
$appToSymlink = @(
|
||||
@{
|
||||
Name = 'gitui';
|
||||
Path = "$env:APPDATA";
|
||||
},
|
||||
@{
|
||||
Name = 'nvim';
|
||||
Path = "$env:LOCALAPPDATA";
|
||||
}
|
||||
)
|
||||
Foreach ($item in $appToSymlink) {
|
||||
$symlink_folder = $item.Path + '\' + $item.Name
|
||||
$name = $item.Name
|
||||
$config_folder = "$env:USERPROFILE\.config\$name"
|
||||
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
|
||||
}
|
||||
Exit
|
||||
|
|
Loading…
Reference in a new issue