| 96 | } |
| 97 | |
| 98 | func (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 | |
| 121 | func (d *deployCmd) checkProject() error { |
| 122 | depcheck := depcheck.NewDepCheck() |