commands

package
v0.0.0-...-da0b44c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Run = cli.Command{
	Name:        "run",
	Aliases:     []string{"r"},
	Usage:       "Run your workflow described by CWL",
	ArgsUsage:   "[file.cwl] [inputs.yaml]",
	Description: "Run the cwl",
	Action: func(ctx *cli.Context) (err error) {

		cwlfile, err := os.Open(ctx.Args().First())
		if err != nil {
			return fmt.Errorf("failed to open CWL: %v", err)
		}
		defer cwlfile.Close()

		root := cwl.NewCWL()
		if err = root.Decode(cwlfile); err != nil {
			return fmt.Errorf("failed to decode CWL file: %v", err)
		}
		if root.Path, err = filepath.Abs(cwlfile.Name()); err != nil {
			return err
		}

		paramfile, err := os.Open(ctx.Args().Get(1))
		if err != nil {
			return fmt.Errorf("failed to open parameter file: %v", err)
		}
		defer paramfile.Close()

		params := cwl.NewParameters()
		if err = params.Decode(paramfile); err != nil {
			return fmt.Errorf("failed to decode parameter file: %v", err)
		}

		handler, err := core.NewHandler(root)
		if err != nil {
			return fmt.Errorf("failed to instantiate yacle.Handler: %v", err)
		}

		handler.Outdir = ctx.String("outdir")
		handler.Quiet = ctx.Bool("quiet")

		handler.Quiet = false
		handler.SetLogger(log.New(os.Stdout, "[DEBUG]\t", 0))

		return handler.Handle(*params)

	},
}

Run ...

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL