diff --git a/internal/keychain/auth_log.go b/internal/keychain/auth_log.go index 079f8cd9..12b31515 100644 --- a/internal/keychain/auth_log.go +++ b/internal/keychain/auth_log.go @@ -21,6 +21,10 @@ var ( ) func authLogDir() string { + if dir := os.Getenv("LARKSUITE_CLI_LOG_DIR"); dir != "" { + return dir + } + if dir := os.Getenv("LARKSUITE_CLI_CONFIG_DIR"); dir != "" { return filepath.Join(dir, "logs") } diff --git a/internal/keychain/keychain_other.go b/internal/keychain/keychain_other.go index d84ad84b..e369bccc 100644 --- a/internal/keychain/keychain_other.go +++ b/internal/keychain/keychain_other.go @@ -25,6 +25,9 @@ const tagBytes = 16 // StorageDir returns the directory where encrypted files are stored. func StorageDir(service string) string { + if dir := os.Getenv("LARKSUITE_CLI_DATA_DIR"); dir != "" { + return dir + } home, err := vfs.UserHomeDir() if err != nil || home == "" { // If home is missing, fallback to relative path and print warning.