mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-18 13:25:06 +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.
|
// Additionally, the trailing ".template" is stripped from the file name.
|
||||||
// Also, dot files and dot directories are skipped.
|
// Also, dot files and dot directories are skipped.
|
||||||
func CopyDir(destDir, srcDir string, data map[string]interface{}) error {
|
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 {
|
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
|
// Get the relative path from the source base, and the corresponding path in
|
||||||
// the dest directory.
|
// the dest directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user