@humanu/orchestra 0.5.52 → 0.5.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/resources/api/tmux.sh +20 -5
- package/resources/prebuilt/linux-x64/orchestra +0 -0
- package/resources/prebuilt/macos-arm64/orchestra +0 -0
- package/resources/prebuilt/macos-intel/orchestra +0 -0
- package/resources/scripts/shell/git/bridge_delete_branch_only.sh +6 -8
- package/resources/scripts/shell/git/bridge_delete_worktree_only.sh +6 -10
package/package.json
CHANGED
package/resources/api/tmux.sh
CHANGED
|
@@ -435,20 +435,35 @@ tmux_list_sessions_for_slug() {
|
|
|
435
435
|
d="$(_tmux_delim)"
|
|
436
436
|
ORCH_PREFIX="$(_tmux_orch_prefix)"
|
|
437
437
|
|
|
438
|
-
# If worktree_path provided, match
|
|
438
|
+
# If worktree_path provided, match hash-based and no-hash prefixes
|
|
439
439
|
if [[ -n "$worktree_path" ]]; then
|
|
440
|
-
local hash_slug hash_path
|
|
440
|
+
local hash_slug hash_path branch_name
|
|
441
441
|
hash_slug="$(tmux_path_hash "$slug")"
|
|
442
442
|
hash_path="$(tmux_path_hash "$worktree_path")"
|
|
443
|
+
branch_name="$(git_worktree_path_to_branch "$worktree_path" 2>/dev/null || true)"
|
|
444
|
+
|
|
443
445
|
local p1_new="${ORCH_PREFIX}${slug}${d}${hash_slug}${d}"
|
|
444
446
|
local p2_new="${slug}${d}${hash_slug}${d}"
|
|
445
447
|
local p1_old="${ORCH_PREFIX}${slug}${d}${hash_path}${d}"
|
|
446
448
|
local p2_old="${slug}${d}${hash_path}${d}"
|
|
447
|
-
|
|
448
|
-
|
|
449
|
+
local p1_plain="${ORCH_PREFIX}${slug}${d}"
|
|
450
|
+
local p2_plain="${slug}${d}"
|
|
451
|
+
|
|
452
|
+
local p1_branch_hash=""
|
|
453
|
+
local p2_branch_hash=""
|
|
454
|
+
local p1_branch_plain=""
|
|
455
|
+
local p2_branch_plain=""
|
|
456
|
+
if [[ -n "$branch_name" ]]; then
|
|
457
|
+
p1_branch_hash="${ORCH_PREFIX}${branch_name}${d}${hash_path}${d}"
|
|
458
|
+
p2_branch_hash="${branch_name}${d}${hash_path}${d}"
|
|
459
|
+
p1_branch_plain="${ORCH_PREFIX}${branch_name}${d}"
|
|
460
|
+
p2_branch_plain="${branch_name}${d}"
|
|
461
|
+
fi
|
|
462
|
+
|
|
463
|
+
# List sessions with any known prefix variant
|
|
449
464
|
tmux list-sessions -F '#{session_name}|||#{session_last_attached}|||#{session_activity}' 2>/dev/null \
|
|
450
465
|
| sed 's/|||/\t/g' \
|
|
451
|
-
| awk -v a="$p1_new" -v b="$p2_new" -v c="$p1_old" -v d="$p2_old" 'BEGIN{FS="\t"} index($1, a)==1 || index($1, b)==1 || index($1, c)==1 || index($1, d)==1 {print $1"\t"$2"\t"$3}' \
|
|
466
|
+
| awk -v a="$p1_new" -v b="$p2_new" -v c="$p1_old" -v d="$p2_old" -v e="$p1_plain" -v f="$p2_plain" -v g="$p1_branch_hash" -v h="$p2_branch_hash" -v i="$p1_branch_plain" -v j="$p2_branch_plain" 'BEGIN{FS="\t"} (length(a)>0 && index($1, a)==1) || (length(b)>0 && index($1, b)==1) || (length(c)>0 && index($1, c)==1) || (length(d)>0 && index($1, d)==1) || (length(e)>0 && index($1, e)==1) || (length(f)>0 && index($1, f)==1) || (length(g)>0 && index($1, g)==1) || (length(h)>0 && index($1, h)==1) || (length(i)>0 && index($1, i)==1) || (length(j)>0 && index($1, j)==1) {print $1"\t"$2"\t"$3}' \
|
|
452
467
|
| sort -t $'\t' -k2,2nr -k3,3nr \
|
|
453
468
|
| awk -F '\t' '{print $1}' | awk '!seen[$0]++' || true
|
|
454
469
|
else
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
|
-
# Delete
|
|
6
|
-
|
|
5
|
+
# Delete branch only
|
|
6
|
+
bridge_delete_branch_only() {
|
|
7
7
|
if [[ -z "${1:-}" ]]; then
|
|
8
8
|
json_error "Branch name required"
|
|
9
9
|
return 1
|
|
@@ -11,15 +11,13 @@ bridge_delete_worktree_only() {
|
|
|
11
11
|
branch_name="$1"
|
|
12
12
|
|
|
13
13
|
if git_require_repo_root >/dev/null 2>&1; then
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if [[ -n "$worktree_path" ]]; then
|
|
17
|
-
git_remove_worktree "$worktree_path"
|
|
14
|
+
if git_branch_exists "$branch_name"; then
|
|
15
|
+
git_delete_branch "$branch_name"
|
|
18
16
|
echo "true"
|
|
19
17
|
else
|
|
20
|
-
json_error "
|
|
18
|
+
json_error "Branch not found: $branch_name"
|
|
21
19
|
fi
|
|
22
20
|
else
|
|
23
21
|
json_error "Not a git repository"
|
|
24
22
|
fi
|
|
25
|
-
}
|
|
23
|
+
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
|
-
# Delete worktree
|
|
6
|
-
|
|
5
|
+
# Delete worktree only
|
|
6
|
+
bridge_delete_worktree_only() {
|
|
7
7
|
if [[ -z "${1:-}" ]]; then
|
|
8
8
|
json_error "Branch name required"
|
|
9
9
|
return 1
|
|
@@ -12,17 +12,13 @@ bridge_delete_worktree() {
|
|
|
12
12
|
|
|
13
13
|
if git_require_repo_root >/dev/null 2>&1; then
|
|
14
14
|
worktree_path="$(git_branch_to_worktree_path "$branch_name")"
|
|
15
|
-
|
|
16
15
|
if [[ -n "$worktree_path" ]]; then
|
|
17
16
|
git_remove_worktree "$worktree_path"
|
|
17
|
+
echo "true"
|
|
18
|
+
else
|
|
19
|
+
json_error "No worktree found for branch: $branch_name"
|
|
18
20
|
fi
|
|
19
|
-
|
|
20
|
-
if git_branch_exists "$branch_name"; then
|
|
21
|
-
git_delete_branch "$branch_name"
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
echo "true"
|
|
25
21
|
else
|
|
26
22
|
json_error "Not a git repository"
|
|
27
23
|
fi
|
|
28
|
-
}
|
|
24
|
+
}
|