Skip to content

Commit

Permalink
Add info about actions not tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarsonneur committed Oct 5, 2017
1 parent 198dc79 commit cf02b1d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ func (a *Forj) init() {
log.Printf("action create: %s", a.cli.Error())
}

if a.cli.OnActions(val_act).
AddFlag(cli.String, forjfile_path_f, create_forjfile_help, opts_forjfile)== nil {
log.Printf("action create: %s", a.cli.Error())
}

// Enhance Update. Plugins can add options to update with `only-for-actions`
if a.cli.OnActions(upd_act).
// Add Update workspace flags to Create action, not prefixed.
Expand Down
5 changes: 3 additions & 2 deletions cli_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ func (a *Forj) ParseContext(c *cli.ForjCli, _ interface{}) (error, bool) {
a.w.Load()

// Read definition file from repo.
is_valid_action := (inStringList(action, cr_act, upd_act, maint_act, add_act, rem_act, ren_act, chg_act, list_act) != "")
is_valid_action := (inStringList(action, val_act, cr_act, upd_act, maint_act, add_act, rem_act, ren_act, chg_act, list_act) != "")
need_to_create := (action == cr_act)
if err := a.f.SetInfraPath(a.w.InfraPath(), is_valid_action && need_to_create) ; err != nil {
need_to_validate := (action == val_act)
if err := a.f.SetInfraPath(a.w.InfraPath(), is_valid_action && (need_to_create || need_to_validate)) ; err != nil {
a.w.SetError(err)
return nil, false
}
Expand Down
3 changes: 3 additions & 0 deletions drivers_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func (a *Forj) load_driver_options(instance_name string) error {
return err
}

if a.cli.GetCurrentCommand()[0].FullCommand() == val_act {
return nil // Do not set plugin flags in validate mode.
}
if a.drivers[instance_name].Plugin.Yaml.Name != "" { // if true => Driver Def loaded
if err := a.init_driver_flags(instance_name) ; err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const DefaultUsageTemplate = `{{define "FormatCommand"}}\
{{ range .}}\
{{ if not .Hidden}}\
{{ if eq .Name "add"}}---------------------------------------------------------------------------------------------
Following actions do updates of your software factory source code, by updating forjj or plugins objects settings.
Following actions do updates of your software factory source code, by updating your Forjfile and update plugins objects setup.
FYI: Those actions are not tested, and need to be reworked to make it work. Use it at your own risk.
{{ end}}\
{{ .Depth|Indent}}{{.Name}} {{if .Default}}*{{end}}\
Expand Down

0 comments on commit cf02b1d

Please sign in to comment.