mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-04 02:48:29 +02:00
don't fallback login directly
This commit is contained in:
@ -16,8 +16,10 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"code.gitea.io/tea/modules/config"
|
"code.gitea.io/tea/modules/config"
|
||||||
"code.gitea.io/tea/modules/git"
|
"code.gitea.io/tea/modules/git"
|
||||||
|
"code.gitea.io/tea/modules/theme"
|
||||||
"code.gitea.io/tea/modules/utils"
|
"code.gitea.io/tea/modules/utils"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/huh"
|
||||||
gogit "github.com/go-git/go-git/v5"
|
gogit "github.com/go-git/go-git/v5"
|
||||||
"github.com/urfave/cli/v3"
|
"github.com/urfave/cli/v3"
|
||||||
)
|
)
|
||||||
@ -152,7 +154,18 @@ and then run your command again.`)
|
|||||||
}
|
}
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "NOTE: no gitea login detected, falling back to login '%s'\n", c.Login.Name)
|
|
||||||
|
fallback := false
|
||||||
|
if err := huh.NewConfirm().
|
||||||
|
Title(fmt.Sprintf("NOTE: no gitea login detected, whether falling back to login '%s'?", c.Login.Name)).
|
||||||
|
Value(&fallback).
|
||||||
|
WithTheme(theme.GetTheme()).
|
||||||
|
Run(); err != nil {
|
||||||
|
log.Fatalf("Get confirm failed: %v", err)
|
||||||
|
}
|
||||||
|
if !fallback {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse reposlug (owner falling back to login owner if reposlug contains only repo name)
|
// parse reposlug (owner falling back to login owner if reposlug contains only repo name)
|
||||||
|
Reference in New Issue
Block a user