We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ec7005 commit 05fecc5Copy full SHA for 05fecc5
1 file changed
internal/cmd/root.go
@@ -29,6 +29,10 @@ func Execute() {
29
30
var noMultipleTokenSourcesWarning bool
31
32
+func requiresLogin(cmd *cobra.Command) bool {
33
+ return cmd.Name() != "login" && cmd.Name() != "signup" && cmd.CommandPath() != "turso config set token" && cmd.CommandPath() != "turso update"
34
+}
35
+
36
func init() {
37
rootCmd.PersistentFlags().StringP("config-path", "c", "", "Path to the directory with config file")
38
if err := viper.BindPFlag("config-path", rootCmd.PersistentFlags().Lookup("config-path")); err != nil {
@@ -83,7 +87,7 @@ func init() {
83
87
}
84
88
85
89
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
86
- if cmd.Name() == "login" || cmd.Name() == "signup" {
90
+ if !requiresLogin(cmd) {
91
return
92
93
_, err := getAccessToken()
0 commit comments