From 93f7d865467e4dc9f3895f4f1771789403d3b37c Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sat, 11 Oct 2014 17:49:37 -0700 Subject: [PATCH] remote: Expose CopyFile --- remote/remote.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remote/remote.go b/remote/remote.go index ca592d258..ee3320b2b 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -381,7 +381,7 @@ func Persist(r io.Reader) error { backupPath := filepath.Join(cwd, LocalDirectory, BackupHiddenStateFile) // Backup the old file if it exists - if err := copyFile(statePath, backupPath); err != nil { + if err := CopyFile(statePath, backupPath); err != nil { return fmt.Errorf("Failed to backup state file '%s' to '%s': %v", statePath, backupPath, err) } @@ -401,9 +401,9 @@ func Persist(r io.Reader) error { return nil } -// copyFile is used to copy from a source file if it exists to a destination. +// CopyFile is used to copy from a source file if it exists to a destination. // This is used to create a backup of the state file. -func copyFile(src, dst string) error { +func CopyFile(src, dst string) error { srcFH, err := os.Open(src) if err != nil { if os.IsNotExist(err) {