diff --git a/cmd/snowsaw/bootstrap/bootstrap.go b/cmd/snowsaw/bootstrap/bootstrap.go index faf137d..366865e 100644 --- a/cmd/snowsaw/bootstrap/bootstrap.go +++ b/cmd/snowsaw/bootstrap/bootstrap.go @@ -37,31 +37,30 @@ func NewBootstrapCmd() *cobra.Command { bootstrapCmd := &cobra.Command{ Use: "bootstrap", Short: "Bootstraps all configured snowblocks", + Long: `Bootstraps all configured snowblocks +To process individual snowblocks a list of space-separated paths can be passed as arguments. + `, Run: func(cmd *cobra.Command, args []string) { o.prepare(cmd, args) o.run(cmd, args) }, } - - bootstrapCmd.Flags().StringSliceVarP( - &o.SnowblockPaths, "snowblocks", "s", []string{}, "comma-separated paths to individual snowblock directories") - return bootstrapCmd } func (o *cmdOptions) prepare(cmd *cobra.Command, args []string) { // Use explicit snowblocks if specified, otherwise find all snowblocks within the base directories. - if len(o.SnowblockPaths) > 0 { + if len(args) > 0 { prt.Debugf("Using individual snowblocks instead of configured base directories(s): %s", - color.CyanString("%v", o.SnowblockPaths)) - config.AppConfig.Snowblocks.Paths = o.SnowblockPaths + color.CyanString("%v", args)) + config.AppConfig.Snowblocks.Paths = args } else { if err := o.readSnowblockDirectories(); err != nil { prt.Errorf("Failed to read snowblocks from base directories: %v", err) os.Exit(1) } - o.SnowblockPaths = config.AppConfig.Snowblocks.Paths } + o.SnowblockPaths = config.AppConfig.Snowblocks.Paths } func (o *cmdOptions) readSnowblockDirectories() error { diff --git a/pkg/snowblock/snowblock.go b/pkg/snowblock/snowblock.go index 97a6b04..95378ba 100644 --- a/pkg/snowblock/snowblock.go +++ b/pkg/snowblock/snowblock.go @@ -101,8 +101,8 @@ func (s *Snowblock) Validate(taskRunner map[string]api.TaskRunner) error { // Try to read and encode the task objects when the directory contains a configuration file. configFilePath := filepath.Join(s.Path, fmt.Sprintf("%s.%s", api.ConfigurationFileName, encoder.ExtensionsJson)) if configLoadErr := loadConfigFile(configFilePath, &s.TaskObjects); configLoadErr != nil { - prt.Debugf("Ignoring snowblock directory %s without valid configuration file: %s: %v", - color.CyanString(filepath.Base(s.Path)), color.BlueString(configFilePath), configLoadErr) + prt.Debugf("Ignoring snowblock directory %s: %v", + color.CyanString(filepath.Base(s.Path)), configLoadErr) return nil }