예제 #1
0
파일: load.go 프로젝트: alexandrev/eris-cli
func LoadActionDefinition(actionName string) (*def.Action, []string, error) {
	logger.Infof("Reading action def file =>\t%v\n", actionName)
	act := strings.Split(actionName, "_")
	action := def.BlankAction()

	act, actionVars := cullCLIVariables(act)
	actionConf, dropped, err := readActionDefinition(act, make(map[string]string), 1)
	if err != nil {
		return action, actionVars, err
	}

	err = marshalActionDefinition(actionConf, action)
	if err != nil {
		return action, actionVars, err
	}

	if len(dropped) != 0 {
		fixSteps(action, dropped)
	}

	return action, actionVars, nil
}
예제 #2
0
파일: load.go 프로젝트: alexandrev/eris-cli
func MockAction(act string) (*def.Action, []string) {
	action := def.BlankAction()
	logger.Debugf("Mocking action =>\t\t%v\n", act)
	return action, []string{}
}
예제 #3
0
func MockAction(act string) (*def.Action, []string) {
	action := def.BlankAction()
	log.WithField("file", act).Debug("Mocking action")
	return action, []string{}
}