mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Added check for copy dir
CopyDir should not fail if the source folder does not exist.
This commit is contained in:
@@ -160,6 +160,9 @@ func PanicOnError(err error, msg string) {
|
||||
// Additionally, the trailing ".template" is stripped from the file name.
|
||||
// Also, dot files and dot directories are skipped.
|
||||
func CopyDir(destDir, srcDir string, data map[string]interface{}) error {
|
||||
if !DirExists(srcDir) {
|
||||
return nil
|
||||
}
|
||||
return fsWalk(srcDir, srcDir, func(srcPath string, info os.FileInfo, err error) error {
|
||||
// Get the relative path from the source base, and the corresponding path in
|
||||
// the dest directory.
|
||||
|
||||
Reference in New Issue
Block a user