goBuild builds the doltgres parser and doltgres binary and returns the filename for the doltgres binary
(ctx context.Context, parserScriptPath, doltgresCommandPath, source, dest string)
| 144 | |
| 145 | // goBuild builds the doltgres parser and doltgres binary and returns the filename for the doltgres binary |
| 146 | func goBuild(ctx context.Context, parserScriptPath, doltgresCommandPath, source, dest string) (string, error) { |
| 147 | buildParser := builder.ExecCommand(ctx, "/bin/bash", "-c", parserScriptPath) |
| 148 | err := buildParser.Run() |
| 149 | if err != nil { |
| 150 | return "", err |
| 151 | } |
| 152 | |
| 153 | doltgresFileName := "doltgres" |
| 154 | if runtime.GOOS == "windows" { |
| 155 | doltgresFileName = "doltgres.exe" |
| 156 | } |
| 157 | toBuild := filepath.Join(dest, doltgresFileName) |
| 158 | |
| 159 | build := builder.ExecCommand(ctx, "go", "build", "-o", toBuild, doltgresCommandPath) |
| 160 | build.Dir = source |
| 161 | err = build.Run() |
| 162 | if err != nil { |
| 163 | return "", err |
| 164 | } |
| 165 | return toBuild, nil |
| 166 | } |
| 167 | |
| 168 | // doltgresVersion prints doltgres version of binary |
| 169 | func doltgresVersion(ctx context.Context, dir, command string) error { |