Skip to content

Commit ab5548f

Browse files
committed
chore(bootstrap): add apply-time package maintenance updates
Run periodic package maintenance during chezmoi apply by updating and upgrading Homebrew on Unix and upgrading Chocolatey and Winget packages on Windows. Made-with: Cursor
1 parent 558d808 commit ab5548f

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{ if ne .chezmoi.os "windows" -}}
2+
#!/bin/bash
3+
4+
# -e: exit on error
5+
# -u: exit on unset variables
6+
set -eu
7+
8+
if command -v brew >/dev/null 2>&1; then
9+
brew update
10+
brew outdated --greedy --verbose
11+
brew upgrade --cask --greedy
12+
brew upgrade --greedy
13+
brew cleanup
14+
fi
15+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{ if eq .chezmoi.os "windows" -}}
2+
$ErrorActionPreference = "Stop"
3+
4+
if (Get-Command choco -ErrorAction SilentlyContinue) {
5+
Write-Host "Updating Chocolatey packages..."
6+
choco upgrade all -y --no-progress
7+
}
8+
9+
if (Get-Command winget -ErrorAction SilentlyContinue) {
10+
Write-Host "Updating Winget packages..."
11+
winget upgrade --all --silent --accept-package-agreements --accept-source-agreements
12+
}
13+
{{- end }}

0 commit comments

Comments
 (0)