diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-18 15:41:54 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-18 15:45:04 -0500 |
| commit | cf5755d893fb3c8e33e88b3a70904f236f7fe3d0 (patch) | |
| tree | 9e71a054a07b8e89e25145cba8b74fcfbc271108 | |
| parent | 024461fcfb03981ccb474b2361d4b1a42586b5e5 (diff) | |
push.sh: fix hostname extraction from path
| -rwxr-xr-x | Omni/Ide/push.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Omni/Ide/push.sh b/Omni/Ide/push.sh index a713e46..79f46af 100755 --- a/Omni/Ide/push.sh +++ b/Omni/Ide/push.sh @@ -34,7 +34,6 @@ derive_service_name() { # Convert slashes to hyphens and lowercase echo "$base" | tr '/' '-' | tr '[:upper:]' '[:lower:]' } - # NixOS deploy (existing behavior) nixos_deploy() { local target="$1" @@ -50,11 +49,11 @@ nixos_deploy() { "$what/etc/systemd/system/domainname.service") # Check if we're deploying to ourselves (local deploy) - # Extract hostname from NixOS config path (e.g., Omni.Dev.Beryllium.nix -> beryllium) + # Extract hostname from NixOS config path (e.g., Omni/Dev/Beryllium.nix -> beryllium) local current_hostname current_hostname=$(hostname) local config_hostname - config_hostname=$(echo "$target" | sed -E 's/.*\.([^.]+)\.nix$/\1/' | tr '[:upper:]' '[:lower:]') + config_hostname=$(basename "$1" .nix | tr '[:upper:]' '[:lower:]') if [[ "$current_hostname" == "$config_hostname" ]] || [[ "$where" == "localhost" ]]; then echo -e "${YLW}info: push: local deploy detected${NC}" |
