Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CmakeCmd = &cobra.Command{ Use: "cmake", Short: "Auto upgrade CMakeLists.txt", Long: `Auto upgrade CMakeLists.txt. Example: tarsgo upgrade cmake`, Run: func(cmd *cobra.Command, args []string) { wd, err := os.Getwd() if err != nil { panic(err) } cmakeListsTxt := path.Join(wd, "CMakeLists.txt") err = base.CopyFile(cmakeListsTxt, cmakeListsTxt, []string{ "${GOPATH}/src/github.com/TarsCloud/TarsGo/", "${CMAKE_CURRENT_SOURCE_DIR}/", }) if err != nil { panic(err) } err = bindata.RestoreAssets(wd, "cmake") if err != nil { panic(err) } fmt.Println(color.GreenString("upgrade success")) }, }
CmakeCmd represents the new command.
View Source
var CmdNew = &cobra.Command{
Use: "upgrade",
Short: "Auto upgrade tarsgo and tars2go",
Long: `Auto upgrade tarsgo and tars2go. Example:
tarsgo upgrade`,
Run: run,
}
CmdNew UpgradeCmd represents the new command.
View Source
var MakeCmd = &cobra.Command{ Use: "make", Short: "Auto upgrade makefile", Long: `Auto upgrade makefile. Example: tarsgo upgrade make`, Run: func(cmd *cobra.Command, args []string) { wd, err := os.Getwd() if err != nil { panic(err) } makefile := path.Join(wd, "makefile") err = base.CopyFile(makefile, makefile, []string{ ` libpath=${subst :, ,$(GOPATH)}`, "", "$(foreach path,$(libpath),$(eval -include $(path)/src/github.com/TarsCloud/TarsGo/tars/makefile.tars))", "-include " + consts.IncludeMakefile, "$(foreach path,$(libpath),$(eval -include $(path)/src/github.com/TarsCloud/TarsGo/tars/makefile.tars.gomod))", "-include " + consts.IncludeMakefile, }) if err != nil { panic(err) } err = bindata.RestoreAsset(wd, consts.IncludeMakefile) if err != nil { panic(err) } fmt.Println(color.GreenString("upgrade success")) }, }
MakeCmd represents the new command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.