From 7166937b130fac7afb3d1c692ffba92afc464a6d Mon Sep 17 00:00:00 2001 From: probablycorey Date: Wed, 5 Feb 2014 17:34:14 -0800 Subject: [PATCH] Copy symlinked directories as files Closes #1515 --- build/tasks/task-helpers.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/tasks/task-helpers.coffee b/build/tasks/task-helpers.coffee index 558760555..39f3a34fe 100644 --- a/build/tasks/task-helpers.coffee +++ b/build/tasks/task-helpers.coffee @@ -11,6 +11,7 @@ module.exports = (grunt) -> stats = fs.lstatSync(sourcePath) if stats.isSymbolicLink() + console.log sourcePath, destinationPath grunt.file.mkdir(path.dirname(destinationPath)) fs.symlinkSync(fs.readlinkSync(sourcePath), destinationPath) else if stats.isFile() @@ -26,7 +27,13 @@ module.exports = (grunt) -> onFile = (sourcePath) -> destinationPath = path.join(destination, path.relative(source, sourcePath)) copyFile(sourcePath, destinationPath) - onDirectory = -> true + onDirectory = (sourcePath) -> + if fs.isSymbolicLinkSync(sourcePath) + destinationPath = path.join(destination, path.relative(source, sourcePath)) + copyFile(sourcePath, destinationPath) + false + else + true fs.traverseTreeSync source, onFile, onDirectory catch error grunt.fatal(error)