Last active
February 13, 2018 22:22
-
-
Save sdaaish/edeb54f0a7c0c1437c0eaee921905731 to your computer and use it in GitHub Desktop.
Create links to dotfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string[]]$directories = @("~", "~\AppData\Roaming") | |
# Creates links in both ~ and AppData\Roaming | |
Function create-link([string]$file, [string]$dir) { | |
$link = (Join-Path -Path $dir -Childpath $file) | |
New-Item -Name $file -Path $dir -Type SymbolicLink -Value $link | |
} | |
# Emacs links | |
foreach ($dir in $directories){ | |
create-link .emacs.d ~\Repos\emacs.d | |
} | |
# Special stuff in AppData\Roaming | |
New-Item -Name .ssh -Path ~\Appdata\Roaming -Type SymbolicLink -Value ~\.ssh | |
New-Item -Name repos -Path ~\Appdata\Roaming -Type SymbolicLink -Value ~\repos | |
# Create links in ~ to AppData\Roaming | |
New-Item -Name gnupg -Path ~ -Type SymbolicLink -Value ~\AppData\Roaming\gnupg | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string[]]$directories = @("~", "~\AppData\Roaming") | |
Function create-link([string]$file, [string]$dir) { | |
$link = (Join-Path -Path $dir -Childpath $file) | |
New-Item -Name $file -Path $dir -Type SymbolicLink -Value $link | |
} | |
foreach ($dir in $directories){ | |
create-link .gitconfig ~\Repos\dotconfig | |
create-link .gitignore ~\Repos\dotconfig | |
create-link .gitconfig.local ~\Repos\git-personal | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment