first commit
This commit is contained in:
11
cli/internal/update/replace.go
Normal file
11
cli/internal/update/replace.go
Normal file
@@ -0,0 +1,11 @@
|
||||
//go:build !windows
|
||||
|
||||
package update
|
||||
|
||||
import "os"
|
||||
|
||||
// atomicReplace replaces oldPath with newPath using os.Rename.
|
||||
// On Unix systems, this is atomic if both paths are on the same filesystem.
|
||||
func atomicReplace(oldPath, newPath string) error {
|
||||
return os.Rename(newPath, oldPath)
|
||||
}
|
||||
Reference in New Issue
Block a user