This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.muchsync: sync with green if verbose

+21 -10
+21 -10
tools/muchsync/flake-module.nix
··· 41 41 fi 42 42 } 43 43 44 - # Check if arguments look like flags or a hostname 45 - has_hostname=false 46 - for arg in "$@"; do 47 - case "$arg" in 48 - -*) ;; # This is a flag 49 - *) has_hostname=true; break ;; # Found a non-flag argument 50 - esac 51 - done 44 + # Check if we should do auto-sync 45 + # Auto-sync if no args or only verbose/config flags 46 + auto_sync=false 47 + if [ $# -eq 0 ]; then 48 + auto_sync=true 49 + else 50 + # Check if all args are sync-compatible flags 51 + all_sync_flags=true 52 + for arg in "$@"; do 53 + case "$arg" in 54 + -v|-vv|-vvv|--verbose) ;; # Verbose flags 55 + --config|--config=*) ;; # Config flags 56 + -*) all_sync_flags=false; break ;; # Unknown flag, don't auto-sync 57 + *) all_sync_flags=false; break ;; # Non-flag argument, don't auto-sync 58 + esac 59 + done 60 + if [ "$all_sync_flags" = true ]; then 61 + auto_sync=true 62 + fi 63 + fi 52 64 53 - # If only flags provided (or no args), do a sync with green host 54 - if [ "$has_hostname" = "false" ]; then 65 + if [ "$auto_sync" = true ]; then 55 66 host=$(find_green_host) 56 67 echo "Syncing with $host..." >&2 57 68