From 644d6e12bd7ea8bbbcf12e8b767dc2a751b9d0a1 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 10 Oct 2018 11:40:29 -0700 Subject: [PATCH] Added check for copy dir CopyDir should not fail if the source folder does not exist. --- utils/file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/file.go b/utils/file.go index e51ddef..0cbfbe5 100644 --- a/utils/file.go +++ b/utils/file.go @@ -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.