diff options
Diffstat (limited to 'modules/util/copy.go')
-rw-r--r-- | modules/util/copy.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/util/copy.go b/modules/util/copy.go new file mode 100644 index 0000000000..46765849dc --- /dev/null +++ b/modules/util/copy.go @@ -0,0 +1,20 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package util + +import ( + "github.com/unknwon/com" +) + +// CopyFile copies file from source to target path. +func CopyFile(src, dest string) error { + return com.Copy(src, dest) +} + +// CopyDir copy files recursively from source to target directory. +// It returns error when error occurs in underlying functions. +func CopyDir(srcPath, destPath string) error { + return com.CopyDir(srcPath, destPath) +} |