lib

package
v0.0.0-...-ccd214f Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_ZIP  = "zip"
	CMD_PACK = "pack"
)

Variables

View Source
var CLI = struct {
	File          string   `help:"File to be used - Defaults are: .mk.yaml, .mk, mk, mk.yaml" short:"f"`
	Init          bool     `help:"Creates a new empty file (default is .mk.yaml in case no filename is provided)" short:"i"`
	Tasks         []string `arg:"" help:"Tasks to be run - Default is main." default:"."`
	Ver           bool     `help:"Prints version and exit" short:"v"`
	List          bool     `help:"Check file and print tasks" short:"l"`
	Dbg           bool     `help:"Debugs execution" short:"d"`
	DumpValidator bool     `help:"Dumps Validator JSON File" default:"false"`
	Env           bool     `help:"Dumps env and vars" default:"false" short:"e"`
}{}

Functions

func DumpEnv

func DumpEnv()

func DumpValidator

func DumpValidator() error

func FileExists

func FileExists(filename string) bool

func InitCli

func InitCli()

func InitFile

func InitFile() error

func Log

func Log(i int, task string, stream string, b string)

func Prepare

func Prepare() error

func RecursiveZip

func RecursiveZip(i int, pathToZip, destinationPath string) error

func ResolveConfig

func ResolveConfig() (err error)

func Run

func Run() error

func RunMkCmd

func RunMkCmd(i int, line string) error

func RunTask

func RunTask(name string, t *MkTask, variant string, l int) error

func Ver

func Ver(end bool)

Types

type MkModel

type MkModel struct {
	Env      map[string]string      `yaml:"env"`
	Vars     map[string]string      `yaml:"vars"`
	RawTasks map[string]interface{} `yaml:"tasks"`
	Tasks    map[string]*MkTask     `yaml:"-"`
	Default  string                 `yaml:"default"`
	Stack    map[string]string      `yaml:"-"`
	Debug    bool                   `yaml:"debug"`
	Trace    bool                   `yaml:"trace"`
}

type MkTask

type MkTask struct {
	Name     string
	Help     string
	Cmd      string            `yaml:"cmd"`
	Pre      []string          `yaml:"pre"`
	Onerror  string            `yaml:"onerror"`
	Env      map[string]string `yaml:"env"`
	Vars     map[string]string `yaml:"vars"`
	Model    string            `yaml:"model"`
	Variants []string          `yaml:"variants"`
}

func ResolveTask

func ResolveTask(n string) *MkTask

Jump to

Keyboard shortcuts

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