Skip to content

Commit

Permalink
Merge pull request #5577 from santhoshivan23/feat/cli-validate-tilde-…
Browse files Browse the repository at this point in the history
…expansion

cli: tilde expansion for validate command
  • Loading branch information
jbw976 committed Apr 12, 2024
2 parents 8669962 + 6574134 commit a62a085
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/crank/beta/validate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package validate
import (
"os"
"path/filepath"
"strings"

"github.com/alecthomas/kong"
"github.com/spf13/afero"
Expand Down Expand Up @@ -117,6 +118,11 @@ func (c *Cmd) Run(k *kong.Context, _ logging.Logger) error {
c.CacheDir = filepath.Join(currentPath, c.CacheDir)
}

if strings.HasPrefix(c.CacheDir, "~/") {
homeDir, _ := os.UserHomeDir()
c.CacheDir = filepath.Join(homeDir, c.CacheDir[2:])
}

m := NewManager(c.CacheDir, c.fs, k.Stdout)

// Convert XRDs/CRDs to CRDs and add package dependencies
Expand Down

0 comments on commit a62a085

Please sign in to comment.