MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / validatePath

Method validatePath

commands/deploy/flags.go:83–98  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

81}
82
83func (c *Command) validatePath(path string) error {
84 if utils.IsBlank(path) {
85 return fmt.Errorf("Path [%s] is blank", path)
86 }
87
88 absPath, err := filepath.Abs(path)
89 if err != nil {
90 return fmt.Errorf("Failed to determine absolute path [%s]", path)
91 }
92
93 if _, err := os.Stat(absPath); os.IsNotExist(err) {
94 return errors.New("Path [%s] does not exist")
95 }
96
97 return nil
98}

Callers 1

validateFlagsMethod · 0.95

Implementers 8

Commandcommands/clusterstatus/command.go
Commandcommands/deploy/command.go
Commandcommands/clusterdelete/command.go
Commandcommands/delete/command.go
Commandcommands/clustercreate/command.go
Commandcommands/create/command.go
Commandcommands/clusterscale/command.go
Commandcommands/status/command.go

Calls

no outgoing calls

Tested by

no test coverage detected