(fromDir, toDir, version string)
| 229 | } |
| 230 | |
| 231 | func copyBinary(fromDir, toDir, version string) error { |
| 232 | binaryName := buildvars.BinaryName.Get() |
| 233 | if version != localVersion { |
| 234 | binaryName = fmt.Sprintf(binaryNameFmt, version) |
| 235 | } |
| 236 | fromPath := filepath.Join(fromDir, binaryName) |
| 237 | toPath := filepath.Join(toDir, buildvars.BinaryName.Get()) |
| 238 | if err := copyFile(fromPath, toPath); err != nil { |
| 239 | return errors.Wrapf(err, "error while copying binary into tempBinDir [%v], from [%v]", toPath, fromPath) |
| 240 | } |
| 241 | return nil |
| 242 | } |
| 243 | |
| 244 | func copyFile(src, dst string) error { |
| 245 | // Validate inputs |
no test coverage detected