INNER CODE UNIT · Go

applyGitConfigs

alibaba/loongcollector · tools/builder/main.go:210

func applyGitConfigs(ctx *buildContext) error {
	if len(ctx.Config.Project.GitConfigs) == 0 {
		return nil
	}
	for k, v := range ctx.Config.Project.GitConfigs {
		cmd := exec.Command(ctx.GitExe, "config", "--global", k, v)
		cmd.Dir = ctx.ProjectRoot
		out, err := cmd.CombinedOutput()
		if err != nil {
			return fmt.Errorf("failed to apply git config, err: %w, output: %s", err, out)
		}
		fmt.Println("apply git config:", k, v)
	}
	return nil
}

func applyGoEnvs(ctx *buildContext) error {
	if len(ctx.Config.Project.GoEnvs) == 0 {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…