Establish beta and staging release channels, move indexes to helper

This commit is contained in:
Daniel
2021-06-03 23:28:41 +02:00
parent 8a46e78c0f
commit 642e2eb112
7 changed files with 161 additions and 120 deletions

View File

@@ -351,10 +351,9 @@ func upgradeFile(fileToUpgrade string, file *updater.File) error {
}
// CopyFile atomically copies a file using the update registry's tmp dir.
func CopyFile(srcPath, dstPath string) (err error) {
func CopyFile(srcPath, dstPath string) error {
// check tmp dir
err = registry.TmpDir().Ensure()
err := registry.TmpDir().Ensure()
if err != nil {
return fmt.Errorf("could not prepare tmp directory for copying file: %w", err)
}
@@ -369,14 +368,14 @@ func CopyFile(srcPath, dstPath string) (err error) {
// open source
srcFile, err := os.Open(srcPath)
if err != nil {
return
return err
}
defer srcFile.Close()
// copy data
_, err = io.Copy(atomicDstFile, srcFile)
if err != nil {
return
return err
}
// finalize file