aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2026-09-26 22:12:36 +0200
committerSimen A. W. Olsen <hello@simenandre.no>2026-09-26 22:12:36 +0200
commit9c68e811a0f96f83e610f39f527fbcd64336a8a5 (patch)
tree06ac9413c7a3d74f3c58c04f44480acfee9e2f85
parent43de6e2d54cae0a9d54598e9f0fac6e86afb532d (diff)
downloaddotfiles-9c68e811a0f96f83e610f39f527fbcd64336a8a5.tar.gz
dotfiles-9c68e811a0f96f83e610f39f527fbcd64336a8a5.zip
feat(home): label herdr spaces <org>/<repo>
-rw-r--r--modules/home/herdr.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/home/herdr.nix b/modules/home/herdr.nix
index d1a98c3..886f24c 100644
--- a/modules/home/herdr.nix
+++ b/modules/home/herdr.nix
@@ -10,7 +10,9 @@ let
sel=$(ghq list -p | fzf --prompt 'repo ❯ ' --reverse) || exit 0
[ -n "''${sel:-}" ] || exit 0
- label=''${sel##*/}
+ # ghq lays repos out as ~/ghq/<host>/<org>/<repo>; label the space <org>/<repo>.
+ parent=''${sel%/*}
+ label="''${parent##*/}/''${sel##*/}"
existing=$(herdr workspace list \
| jq -r --arg l "$label" '.result.workspaces[] | select(.label == $l) | .workspace_id' \
| head -n1)
@@ -39,7 +41,8 @@ let
[ -n "$dir" ] || dir=$(ghq list -p "$q" | head -n1)
[ -n "$dir" ] || exit 0
- label=''${dir##*/}
+ parent=''${dir%/*}
+ label="''${parent##*/}/''${dir##*/}"
herdr workspace create --cwd "$dir" --label "$label" --focus >/dev/null
'';
};