Add Update-Dotfiles command

This commit is contained in:
2020-07-14 22:33:28 +01:00
parent d0588730f2
commit 8d25606414
2 changed files with 8 additions and 2 deletions

4
bin/bin/pull-dotfiles → bin/bin/update-dotfiles Executable file → Normal file
View File

@@ -2,9 +2,9 @@
if [ -d "${HOME}/.dotfiles" ]; then if [ -d "${HOME}/.dotfiles" ]; then
cd $HOME/.dotfiles cd $HOME/.dotfiles
git reset --hard && git pull git pull --rebase --autostash
fi fi
if [ -d "${HOME}/.dotfiles-private" ]; then if [ -d "${HOME}/.dotfiles-private" ]; then
cd $HOME/.dotfiles-private cd $HOME/.dotfiles-private
git reset --hard && git pull git pull --rebase --autostash
fi fi

View File

@@ -14,6 +14,12 @@ function Add-SshKey {
} }
} }
function Update-Dotfiles {
Join-Path $HOME '.dotfiles' | Push-Location
Invoke-Expression -Command "git pull --rebase --autostash"
Pop-Location
}
$DotFilesPath = Join-Path $HOME '.dotfiles' $DotFilesPath = Join-Path $HOME '.dotfiles'
$DotFilesAutodetect = $true $DotFilesAutodetect = $true
$DotFilesAllowNestedSymlinks = $true $DotFilesAllowNestedSymlinks = $true