From 4d9af2ef462fa0024289cbd248b9e413e6df122e Mon Sep 17 00:00:00 2001 From: jpeters5392 Date: Mon, 31 Mar 2014 12:02:18 -0500 Subject: [PATCH] Added theme compare before copying assets Added a check to compare the current theme's absolute path with the default theme's absolute path. If they are the same path then only copy the default theme's files to the output folder and skip the unnecessary copy of the current theme. This resolved an issue with antivirus software occasionally locking the copied files after the first copy and causing the second unnecessary copy to fail. --- lib/builder.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/builder.js b/lib/builder.js index f233a087..dd31aca3 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -1618,10 +1618,13 @@ YUI.add('doc-builder', function (Y) { if (!Y.Files.isDirectory(path.join(self.options.outdir, 'assets'))) { fs.mkdirSync(path.join(self.options.outdir, 'assets'), 0777); } - Y.Files.copyAssets([ - path.join(DEFAULT_THEME, 'assets'), - path.join(themeDir, 'assets') - ], + var defaultThemePath = fs.realpathSync(path.join(DEFAULT_THEME, 'assets')); + var currentThemePath = fs.realpathSync(path.join(themeDir, 'assets')); + var sourceFolders = [path.join(DEFAULT_THEME, 'assets')]; + if (currentThemePath !== defaultThemePath) { + sourceFolders.push(path.join(themeDir, 'assets')); + } + Y.Files.copyAssets(sourceFolders, path.join(self.options.outdir, 'assets'), false, function () {