feat: add directory-scoped host defaults (match_dirs) and repo list --limit
Add match_dirs field to host config entries for directory-based host resolution. When no --hostname flag, FGJ_HOST env var, or git remote is detected, the longest matching directory prefix determines the host. Symlinks are resolved on both sides for macOS compatibility (/tmp → /private/tmp). Also adds --limit/-L flag to repo list.
This commit is contained in:
parent
113505de95
commit
c293e233d2
17 changed files with 252 additions and 79 deletions
|
|
@ -183,7 +183,7 @@ func runMilestoneList(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost())
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -249,7 +249,7 @@ func runMilestoneView(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost())
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -264,7 +264,7 @@ func runMilestoneView(cmd *cobra.Command, args []string) error {
|
|||
if web, _ := cmd.Flags().GetBool("web"); web {
|
||||
// Milestones don't have HTMLURL in the API, construct it
|
||||
cfg2, _ := config.Load()
|
||||
host, _ := cfg2.GetHost("", getDetectedHost())
|
||||
host, _ := cfg2.GetHost("", getDetectedHost(), getCwd())
|
||||
url := fmt.Sprintf("https://%s/%s/%s/milestone/%d", host.Hostname, owner, name, ms.ID)
|
||||
return ios.OpenInBrowser(url)
|
||||
}
|
||||
|
|
@ -315,7 +315,7 @@ func runMilestoneCreate(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost())
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -363,7 +363,7 @@ func runMilestoneEdit(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost())
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -450,7 +450,7 @@ func runMilestoneDelete(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost())
|
||||
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue