Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-distros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
deploy-on-macos:
name: macos:latest
runs-on: macos-latest
env:
HOMEBREW_BUNDLE_MAS_SKIP: "all" # Skip all Mac App Store installations in CI (official Homebrew Bundle env var)
steps:
- name: Prepare environment
run: |
Expand Down
25 changes: 24 additions & 1 deletion home/.chezmoitemplates/install-packages_darwin.tmpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# this comment is to make script update when Brewfile is modified {{- include (joinPath .chezmoi.sourceDir "dot_config/brew/Brewfile") | sha256sum }}
brew bundle install --file="${HOME}/.config/brew/Brewfile"
brew bundle install --file="${HOME}/.config/brew/Brewfile"

if command -v mas >/dev/null 2>&1; then
if mas account >/dev/null 2>&1; then
echo -e "${GREEN}Installing Mac App Store apps via mas${NC}"
MAS_BREWFILE="${HOME}/.config/brew/MasBrewfile"
if [ -f "$MAS_BREWFILE" ]; then
grep '^mas ' "$MAS_BREWFILE" | while read -r line; do
# 解析 id
app_id=$(echo "$line" | sed -n 's/.*id: *\([0-9]\+\).*/\1/p')
if [ -n "$app_id" ]; then
echo -e "${GREEN}Installing app id: $app_id${NC}"
mas install "$app_id"
fi
done
else
echo -e "${GREEN}[mas] 找不到 MasBrewfile,跳過 mas 安裝流程${NC}"
fi
else
echo -e "${GREEN}[mas] 未登入 Apple ID,跳過 mas 安裝流程${NC}"
fi
else
echo -e "${GREEN}[mas] 未安裝 mas,跳過 mas 安裝流程${NC}"
fi
5 changes: 5 additions & 0 deletions home/dot_config/brew/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ brew "git"
brew "gnu-tar"
brew "hugo"
brew "llvm"
brew "mas"
brew "mold"
brew "neovim"
brew "ninja"
Expand Down Expand Up @@ -50,3 +51,7 @@ cask "telegram"
cask "vchewing"
cask "vesktop"
cask "visual-studio-code"
mas "LINE", id: 539883307
mas "Messenger", id: 1480068668
mas "Steam", id: 413730677
mas "Telegram", id: 747648890
Empty file.
Loading