Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildCmd = &cobra.Command{ Use: "build VARIANTFILE", Short: "Create a single executable from the Variantfile", Long: `Create a single executable from the Variantfile`, RunE: func(cmd *cobra.Command, args []string) error { taskDef, err := load.File(args[0]) if err != nil { return err } fmt.Fprintf(os.Stdout, "%#v", taskDef) return nil }, }
View Source
var EnvCmd = &cobra.Command{ Use: "env", Short: "Print currently selected environment", Long: `Print currently selected environment. The environment can be via the command "var env set" or "var env switch". Example: var env switch dev var env #=> Prints "dev" `, Run: func(cmd *cobra.Command, args []string) { env, err := env.Get() if err != nil { panic(err) } fmt.Println(env) }, }
View Source
var InitCmd = &cobra.Command{ Use: "init NAME", Short: "Create a Variant command", Long: `Create a Variant command with the specified NAME Example: cat <<EOF | variant init mycmd tasks: script: | echo Hello Variant! EOF ./mycmd `, Run: func(cmd *cobra.Command, args []string) { bytes, err := ioutil.ReadAll(os.Stdin) if err != nil { panic(err) } header := "#!/usr/bin/env variant\n\n" bytes = append([]byte(header), bytes...) if err := ioutil.WriteFile(args[0], bytes, 0755); err != nil { panic(err) } }, }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.