-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Summary
The storageDir value read from the --storage flag in the preRun method of workspace commands (e.g. pkg/cmd/workspace_list.go) is passed directly to instances.NewManager() without being converted to an absolute path first.
Per coding guidelines, relative paths must be normalized using filepath.Abs() in the preRun method to ensure deterministic behavior regardless of the caller's working directory.
Steps to reproduce
Run kortex workspace list --storage ./relative/path from different working directories and observe inconsistent behavior.
Suggested fix
Add a filepath.Abs() call after reading the --storage flag and before passing it to instances.NewManager():
storageDir, err = filepath.Abs(storageDir)
if err != nil {
return fmt.Errorf("failed to resolve --storage path: %w", err)
}References
- Flagged in PR: feat: list with JSON output #27
- Review comment: feat: list with JSON output #27 (comment)
- Requested by: @feloy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels