diff --git a/CHANGELOG.md b/CHANGELOG.md index bf39e5441..4f5bd59ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.3.1 (September 22, 2017) + +BUG FIXES: + +- [common] fix WriteFileAtomic to not use /tmp, which can be on another device + ## 0.3.0 (September 22, 2017) BREAKING CHANGES: diff --git a/common/os.go b/common/os.go index 9c2bda508..71ee88422 100644 --- a/common/os.go +++ b/common/os.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "os/signal" + "path/filepath" "strings" ) @@ -101,7 +102,8 @@ func MustWriteFile(filePath string, contents []byte, mode os.FileMode) { // WriteFileAtomic writes newBytes to temp and atomically moves to filePath // when everything else succeeds. func WriteFileAtomic(filePath string, newBytes []byte, mode os.FileMode) error { - f, err := ioutil.TempFile("", "") + dir := filepath.Dir(filePath) + f, err := ioutil.TempFile(dir, "") if err != nil { return err } diff --git a/version/version.go b/version/version.go index ee59a7cad..6e030624e 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -const Version = "0.3.0" +const Version = "0.3.1"