borgmatic-base/scripts/pre_macos
2021-09-02 13:48:53 -04:00

22 lines
506 B
Bash
Executable file

#!/bin/bash
restoreDir="$HOME/.borgmatic/restore"
mkdir -p "$restoreDir"
pushd "$restoreDir" || exit
brew bundle dump
cat > "${restoreDir}/restore.sh" <<EOF
#!/bin/bash
if which brew; then
echo "Installing Homebrew Bundle"
brew bundle
else
echo "Install Homebrew first using the following:"
echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)'
echo "Re-run restore.sh after installing Homebrew to install Homebrew Bundle"
fi
EOF
popd || exit