MCPcopy
hub / github.com/dgraph-io/dgraph / copyBinary

Function copyBinary

dgraphtest/image.go:231–242  ·  view source on GitHub ↗
(fromDir, toDir, version string)

Source from the content-addressed store, hash-verified

229}
230
231func 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
244func copyFile(src, dst string) error {
245 // Validate inputs

Callers 1

setupBinaryMethod · 0.85

Calls 2

copyFileFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected