// ReadWorkflow Read the workflow with the specified name from the current project directory
ReadWorkflow Read the workflow with the specified name from the current project directory
// ReadWorkflow Read the workflow with the specified name from the current project directory
func ReadWorkflow(workflowName string) (*workflowsv1.Workflow, error) {
	workflowsDirectory, err := getWorkflowsDirectory()
	if err != nil {
		return nil, err
	}
	workflowFile := filepath.Join(workflowsDirectory, workflowName+workflowExtension)
	log.Debugf(`Looking for workflow "%v" at "%v"`, workflowName, workflowFile)
	workflowFileExists, err := fileExists(workflowFile)
	if err != nil {
		return nil, err
	}
	if !workflowFileExists {
		return nil, os.ErrNotExist
	}
	log.Debugf(`Reading workflow at "%v"`, workflowFile)
	workflowFileContent, err := ioutil.ReadFile(workflowFile)
	if err != nil {
		return nil, err
	}
	projectRoot, err := os.Getwd()
	return workflowsv1.ParseWorkflow(projectRoot, workflowName, workflowFileContent)
}
func ReadWorkflow ( workflowName string ) ( * workflowsv1 . Workflow , error ) { workflowsDirectory , err := getWorkflowsDirectory ( ) if err != nil { return nil , err } workflowFile := filepath . Join ( workflowsDirectory , workflowName + workflowExtension ) log . Debugf ( `Looking for workflow "%v" at "%v"` , workflowName , workflowFile ) workflowFileExists , err := fileExists ( workflowFile ) if err != nil { return nil , err } if ! workflowFileExists { return nil , os . ErrNotExist } log . Debugf ( `Reading workflow at "%v"` , workflowFile ) workflowFileContent , err := ioutil . ReadFile ( workflowFile ) if err != nil { return nil , err } projectRoot , err := os . Getwd ( ) return workflowsv1 . ParseWorkflow ( projectRoot , workflowName , workflowFileContent ) }
ReadWorkflow Read the workflow with the specified name from the current project directory
ReadWorkflow Read the workflow with the specified name from the current project directory