Documentation ¶
Overview ¶
Example (BuildCommand) ¶
viper.SetConfigFile("../.jamgo") viper.SetConfigType("yaml") viper.ReadInConfig() dir := viper.GetString("DIR") os.Chdir("testdata") defer os.Chdir("..") cmd := initCommand() cmd.SetArgs([]string{"buildTest"}) cmd.Execute() os.Chdir("buildTest") defer os.Chdir("..") c := exec.Command("go", "mod", "edit", "-replace", fmt.Sprintf("github.com/SamtheSaint/jamgo=%s", dir)) if e := c.Run(); e != nil { log.Fatalln(e) } buildCommand().Execute()
Output:
Example (InitCommand) ¶
os.Chdir("testdata") defer os.Chdir("..") cmd := initCommand() cmd.SetArgs([]string{"tmp"}) cmd.Execute()
Output:
Example (PageCommand) ¶
err := os.Chdir("testdata") if err != nil { log.Println(os.Getwd()) log.Fatalln(err, "failed here") } defer os.Chdir("..") os.MkdirAll("pages", os.ModePerm) cmd := pageCommand() cmd.SetArgs([]string{"index"}) cmd.Execute()
Output:
Example (TemplateCommand) ¶
cmd := templateCommand() cmd.SetArgs([]string{"componentX"}) cmd.Execute()
Output:
Example (WriteTemplate) ¶
writeTemplate(os.Stdout, "componentX")
Output: {{template "componentX"}} {{end}}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.