fix: ignore hidden directories when enumerating polecats (#258)
* fix(sling): route bd mol commands to target rig directory * Fix daemon polecat enumeration to ignore hidden dirs * Ignore hidden dirs when discovering rig polecats * Fix CI: enable beads custom types during install --------- Co-authored-by: joshuavial <git@codewithjv.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -206,6 +207,33 @@ func TestSaveLoadState_Roundtrip(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestListPolecatWorktrees_SkipsHiddenDirs(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
polecatsDir := filepath.Join(tmpDir, "some-rig", "polecats")
|
||||
|
||||
if err := os.MkdirAll(filepath.Join(polecatsDir, ".claude"), 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Join(polecatsDir, "furiosa"), 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(polecatsDir, "not-a-dir.txt"), []byte("x"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
polecats, err := listPolecatWorktrees(polecatsDir)
|
||||
if err != nil {
|
||||
t.Fatalf("listPolecatWorktrees returned error: %v", err)
|
||||
}
|
||||
|
||||
if slices.Contains(polecats, ".claude") {
|
||||
t.Fatalf("expected hidden dir .claude to be ignored, got %v", polecats)
|
||||
}
|
||||
if !slices.Contains(polecats, "furiosa") {
|
||||
t.Fatalf("expected furiosa to be included, got %v", polecats)
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: TestIsWitnessSession removed - isWitnessSession function was deleted
|
||||
// as part of ZFC cleanup. Witness poking is now Deacon's responsibility.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user