Skip to content

Commit

Permalink
Add sync-dirs, should be really fast and consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Nov 13, 2024
1 parent 82bffa8 commit 11493e8
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ prep-term: prep-kitty
which magick ||brew install imagemagick
just add-zrc 'eval "$(zoxide init zsh)"'
just add-zrc 'eval "$(starship init zsh)"'
# grep ~/.bashrc -F 'eval "$(starship init bash)"' || echo 'eval "$(starship init bash)"' >> ~/.bashrc
which progress || brew install progress
which 7z || brew install sevenzip
which ffmpeg || brew install ffmpeg

prep-alacritty:
#!/usr/bin/env bash
Expand Down Expand Up @@ -399,5 +401,23 @@ lv-local PROJ="forest" PORT="1214":
just lvim {{PROJ}} --server localhost:{{PORT}} --remote-ui
prep-rust:
#!/usr/bin/env bash
set -e
which cargo || (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly)
which cargo || (just add-zrc '. $HOME/.cargo/env' && echo 'Run: . $HOME/.cargo/env')
. $HOME/.cargo/env
which cargo-binstall || cargo install cargo-binstall
prep-sync-dir-tools: prep-rust
which jw || (yes|cargo binstall jw)
which rusync || (yes|cargo binstall rusync)

sync-dirs SRC DST: prep-sync-dir-tools
#!/usr/bin/env bash
echo "🚀 Initiating sync..."
rusync {{SRC}} {{DST}}
echo "🔍 Checking hash..."
(cd {{SRC}} && jw -c . > hash.jw)
(cd {{DST}} && jw -c . > hash.jw)
jw -D {{SRC}}/hash.jw {{DST}}/hash.jw && echo "✅ Sync successful" || echo "❌ Sync with hash mismatch"

0 comments on commit 11493e8

Please sign in to comment.