示例#1
0
文件: list.go 项目: dnephin/dobi
func runList(opts *dobiOptions, listOpts listOptions) error {
	conf, err := config.Load(opts.filename)
	if err != nil {
		return err
	}

	lines := getDescriptions(conf, listOpts)
	if len(lines) == 0 {
		logging.Log.Warn("No resource descriptions")
		return nil
	}
	fmt.Print(strings.Join(lines, ""))
	return nil
}
示例#2
0
文件: autoclean.go 项目: dnephin/dobi
func runClean(opts *dobiOptions) error {
	conf, err := config.Load(opts.filename)
	if err != nil {
		return err
	}

	client, err := buildClient()
	if err != nil {
		return fmt.Errorf("failed to create client: %s", err)
	}

	return tasks.Run(tasks.RunOptions{
		Client: client,
		Config: conf,
		Tasks:  removeTasks(conf),
		Quiet:  opts.quiet,
	})
}
示例#3
0
文件: dobi.go 项目: dnephin/dobi
func runDobi(opts dobiOptions) error {
	if opts.version {
		printVersion()
		return nil
	}

	conf, err := config.Load(opts.filename)
	if err != nil {
		return err
	}

	client, err := buildClient()
	if err != nil {
		return fmt.Errorf("failed to create client: %s", err)
	}

	return tasks.Run(tasks.RunOptions{
		Client: client,
		Config: conf,
		Tasks:  opts.tasks,
		Quiet:  opts.quiet,
	})
}