Skip to content

Brew deps management #4

Description

@pith

Setup brew-wrap. See: https://homebrew-file.readthedocs.io

if [ -f $(brew --prefix)/etc/brew-wrap ]; then
  source $(brew --prefix)/etc/brew-wrap
fi

Disable brew auto update

echo 'export HOMEBREW_NO_AUTO_UPDATE=1' >> ~/.zshrc
source ~/.zshrc

Setup cronjob with launchd

com.user.brewupdate.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.user.brewupdate</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/zsh</string>
        <string>-c</string>
        <string>/opt/homebrew/bin/brew update && /opt/homebrew/bin/brew upgrade</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>0</integer>
        <key>Minute</key>
        <integer>0</integer>
        <key>Weekday</key>
        <integer>0</integer> <!-- Sunday -->
    </dict>
    <key>StandardOutPath</key>
    <string>/tmp/brew-update.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/brew-update.err</string>
</dict>
</plist>

Save in

mkdir -p ~/Library/LaunchAgents
nano ~/Library/LaunchAgents/com.user.brewupdate.plist

Then load

launchctl load ~/Library/LaunchAgents/com.user.brewupdate.plist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions