MCPcopy Create free account
hub / github.com/celer-pkg/celer / validateArgs

Method validateArgs

cmds/cmd_deploy.go:98–119  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

96}
97
98func (d *deployCmd) validateArgs(cmd *cobra.Command, args []string) error {
99 if err := cobra.NoArgs(cmd, args); err != nil {
100 return err
101 }
102
103 if !cmd.Flags().Changed("snapshot") {
104 return nil
105 }
106
107 snapshotPath, err := cmd.Flags().GetString("snapshot")
108 if err != nil {
109 return err
110 }
111
112 snapshotPath = strings.TrimSpace(snapshotPath)
113 if snapshotPath == "" {
114 return fmt.Errorf("--snapshot requires a non-empty path")
115 }
116
117 d.snapshotPath = filepath.Clean(snapshotPath)
118 return nil
119}
120
121func (d *deployCmd) checkProject() error {
122 depcheck := depcheck.NewDepCheck()

Callers

nothing calls this directly

Calls 1

CleanMethod · 0.65

Tested by

no test coverage detected