summaryrefslogtreecommitdiffstats
path: root/utils/file.go
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2017-12-07 15:56:14 -0500
committerGitHub <noreply@github.com>2017-12-07 15:56:14 -0500
commitef597f6fe45cae8b3ba405ff89f5b20bfbf349e5 (patch)
tree612629dd3ee1b3badf17ccd90cd4d37228044b24 /utils/file.go
parent98620d5aa37b117b0e1d3bd3402d24f610bf8a3f (diff)
downloadchat-ef597f6fe45cae8b3ba405ff89f5b20bfbf349e5.tar.gz
chat-ef597f6fe45cae8b3ba405ff89f5b20bfbf349e5.tar.bz2
chat-ef597f6fe45cae8b3ba405ff89f5b20bfbf349e5.zip
PLT-8314: Test Message Export Against S3 Bucket (#7957)
* Removed export directory config setting, in favour of hard-coding it to an 'export' directory under the local file directory. Improved the local file backend copy implementation to implicitly create the destination directory if it's missing * Fixed the tests
Diffstat (limited to 'utils/file.go')
-rw-r--r--utils/file.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/file.go b/utils/file.go
index 13b25bdab..923c559cc 100644
--- a/utils/file.go
+++ b/utils/file.go
@@ -21,6 +21,9 @@ func CopyFile(src, dst string) (err error) {
}
defer in.Close()
+ if err = os.MkdirAll(filepath.Dir(dst), os.ModePerm); err != nil {
+ return
+ }
out, err := os.Create(dst)
if err != nil {
return