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
|
Start-Sleep -Seconds 1
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
$appDatasToSymlink = 'gitui'
|
$appToSymlink = @(
|
||||||
Foreach ($item in $appDatasToSymlink) {
|
@{
|
||||||
$config_folder = "$env:USERPROFILE\.config\$item"
|
Name = 'gitui';
|
||||||
$symlink_folder = "$env:APPDATA\$item"
|
Path = "$env:APPDATA";
|
||||||
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
|
},
|
||||||
|
@{
|
||||||
|
Name = 'nvim';
|
||||||
|
Path = "$env:LOCALAPPDATA";
|
||||||
}
|
}
|
||||||
$localAppDatasToSymlink = 'nvim'
|
)
|
||||||
Foreach ($item in $localAppDatasToSymlink) {
|
Foreach ($item in $appToSymlink) {
|
||||||
$config_folder = "$env:USERPROFILE\.config\$item"
|
$symlink_folder = $item.Path + '\' + $item.Name
|
||||||
$symlink_folder = "$env:LOCALAPPDATA\$item"
|
$name = $item.Name
|
||||||
|
$config_folder = "$env:USERPROFILE\.config\$name"
|
||||||
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
|
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
|
||||||
}
|
}
|
||||||
Exit
|
Exit
|
||||||
|
|
Loading…
Reference in a new issue