mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
f12d279fc2
* feat(config): add command to explicitly dowgrade keychain storage to use file * feat(config): add command to explicitly dowgrade keychain storage to use file * fix(lint): use the corresponding vfs.Xxx() from internal/vfs * fix: optimize scanError && osReadDir * opt: remove CmdConfigKeychainDowngrade wrapper & runF * fix: add downgrade hint on keychain blocked * opt: remove redundant ErrOrphanedCredentials * opt: fix suggested concurrent platformSet issue
29 lines
944 B
Go
29 lines
944 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//go:build !darwin
|
|
|
|
package config
|
|
|
|
import (
|
|
"github.com/larksuite/cli/internal/cmdutil"
|
|
"github.com/larksuite/cli/internal/output"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// NewCmdConfigKeychainDowngrade is registered on all platforms so that
|
|
// `lark-cli config --help` reads the same everywhere. On non-macOS it
|
|
// refuses with a clear message.
|
|
func NewCmdConfigKeychainDowngrade(f *cmdutil.Factory) *cobra.Command {
|
|
_ = f
|
|
cmd := &cobra.Command{
|
|
Use: "keychain-downgrade",
|
|
Short: "Downgrade keychain storage to a local file (macOS only)",
|
|
Long: `Downgrade keychain storage to a local file. This subcommand is only supported on macOS; on this platform the keychain layer already uses local files.`,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return output.ErrValidation("keychain-downgrade is only supported on macOS")
|
|
},
|
|
}
|
|
return cmd
|
|
}
|