示例#1
0
func showTasksOf(ctx *runtime.Runtime) {
	tasks := ctx.TaskIDList()
	sort.Strings(tasks)
	for _, id := range tasks {
		fmt.Println(id)
	}
}
示例#2
0
func runControlScriptOn(ctx *runtime.Runtime) error {
	if controlScript != "" {
		return ctx.RunString(controlScript)
	}

	filename := controlFile
	if _, err := os.Stat(filename); os.IsNotExist(err) {
		filename += ".md"
	}
	if _, err := os.Stat(filename); os.IsNotExist(err) {
		return fmt.Errorf("Control file %v (and %v.md) not found", filename, filename)
	}

	if strings.HasSuffix(filename, ".md") {
		return ctx.RunLiterateFile(filename)
	}

	return ctx.RunFile(filename)
}