fix(routing): complete bd init --contributor routing (bd-6x6g) (#1088)
Implements the missing contributor routing logic so bd init --contributor actually works. Contributors' issues automatically route to ~/.beads-planning/ while maintainers' issues stay local.
This commit is contained in:
committed by
GitHub
parent
b9d2799d29
commit
31239495f1
@@ -1,7 +1,9 @@
|
||||
package routing
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -102,3 +104,28 @@ func DetermineTargetRepo(config *RoutingConfig, userRole UserRole, repoPath stri
|
||||
// No routing configured - use current repo
|
||||
return "."
|
||||
}
|
||||
|
||||
// ExpandPath expands ~ to home directory and resolves relative paths to absolute.
|
||||
// Returns the original path if expansion fails.
|
||||
func ExpandPath(path string) string {
|
||||
if path == "" || path == "." {
|
||||
return path
|
||||
}
|
||||
|
||||
// Expand ~ to home directory
|
||||
if strings.HasPrefix(path, "~/") {
|
||||
home, err := os.UserHomeDir()
|
||||
if err == nil {
|
||||
path = filepath.Join(home, path[2:])
|
||||
}
|
||||
}
|
||||
|
||||
// Convert relative paths to absolute
|
||||
if !filepath.IsAbs(path) {
|
||||
if abs, err := filepath.Abs(path); err == nil {
|
||||
path = abs
|
||||
}
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user