Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove mackup dependency #44

Merged
merged 3 commits into from
Nov 4, 2024
Merged
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
1 change: 0 additions & 1 deletion apps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ ffmpeg = "formula" # Play, record, convert, and stream audio and video
httpie = "formula" # User-friendly cURL replacement (command-line HTTP client)
imagemagick = "formula" # Tools and libraries to manipulate images in many formats
jq = "formula" # Lightweight and flexible command-line JSON processor
mackup = "formula" # Keep your Mac's application settings in sync
nano = "formula" # Free (GNU) replacement for the Pico text editor
nnn = "formula" # Tiny, lightning fast, feature-packed file manager
pandoc = "formula" # Swiss-army knife of markup format conversion
Expand Down
37 changes: 20 additions & 17 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
#!/usr/bin/env bash

# Source the bash_traceback.sh file
source "$(dirname "$0")/bash_traceback.sh"

###############################################################################
# UPDATE DOTFILES #
###############################################################################

cd "$(dirname "${BASH_SOURCE:-$0}")" || exit 1;

git pull origin main;
function dotlink() {
martimlobao marked this conversation as resolved.
Show resolved Hide resolved
find "linkme" -type d -mindepth 1 | sed "s|^linkme/||" | while read -r dir; do mkdir -p "$HOME/$dir"; done
find "linkme" -type f -not -name '.DS_Store' | sed "s|^linkme/||" | while read -r file; do ln -fvns "$(pwd)/linkme/$file" "$HOME/$file"; done
}

# Sync dotfiles (excludes folders, .sh files, .md files, and git files)
function bootstrap() {
rsync --exclude "*.sh" \
--exclude "*.md" \
--exclude ".DS_Store" \
--exclude ".gitignore" \
-f"- */" \
-avh --no-perms . ~;
# shellcheck source=/dev/null
source "$HOME"/.zprofile;
function dotunlink() {
rsync -av --exclude='.DS_Store' linkme/ "$HOME" | \
grep -v "building file list ... done" | \
awk '/^$/ { exit } !/\/$/ { print "Restored " $0 }'
}

if [ "$1" == "--force" ] || [ "$1" == "-f" ]; then
bootstrap;
if [ "$1" == "unlink" ]; then
dotunlink;
elif [ "$1" == "--force" ] || [ "$1" == "-f" ]; then
dotlink;
else
read -rp "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
read -rp $'❓ \e[1;31mThis may overwrite existing files in your home directory. Are you sure? (y/n)\e[0m ' REPLY
if [[ $REPLY =~ ^[Yy]$ ]]; then
bootstrap;
dotlink;
fi;
fi;
unset bootstrap;

# shellcheck source=/dev/null
source "$HOME"/.zprofile
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ git config --file="$HOME"/.gitconfig.private user.email "$(op read "op://Private
git config --file="$HOME"/.gitconfig.private user.signingKey "$(op read "op://Private/Github SSH Commit Signing Key/public key")"
git config --file="$HOME"/.gitconfig.private github.user "$(op read "op://Private/Github/username")"

# Copy all files from manual/ to ~/
read -rp $'❓ \e[1;31mDo you want to copy and overwrite all files from manual/ to $HOME? (y/n)\e[0m ' COPYMANUAL
if [[ $COPYMANUAL =~ ^[Yy]$ ]]; then
cp -r manual/ ~/
# Copy all files from copyme/ to $HOME
read -rp $'❓ \e[1;31mDo you want to copy and overwrite all files from copyme/ to $HOME? (y/n)\e[0m ' COPYME
if [[ $COPYME =~ ^[Yy]$ ]]; then
rsync -av --exclude='.DS_Store' copyme/ "$HOME"
fi

# iStat Menus
Expand Down
15 changes: 0 additions & 15 deletions mackup/.mackup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions mackup/.mackup/aws.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions mackup/.mackup/dotfiles.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions mackup/.mackup/git.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions mackup/.mackup/ruff.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions mackup/.mackup/ssh.cfg

This file was deleted.