grunt-html-inheritance
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -24,3 +24,3 @@ /* | ||
options: { | ||
modules: ["ver1"], //array of modules you want to build additionall to "main" | ||
modules: ["main", "ver1"], //array of modules you want to build additionall to "main" | ||
dstDir: "tmp", | ||
@@ -27,0 +27,0 @@ }, |
{ | ||
"name": "grunt-html-inheritance", | ||
"description": "The engine to build htmls with replacing, inserting or modifing separated tags only using small html patches.", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"homepage": "https://github.com/huston007/grunt-html-inheritance", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -163,78 +163,75 @@ /* | ||
var kindOf = grunt.util.kindOf; | ||
var options = this.options({ | ||
encoding: grunt.file.defaultEncoding, | ||
// processContent/processContentExclude deprecated renamed to process/noProcess | ||
processContent: false, | ||
processContentExclude: [], | ||
mode: false | ||
}); | ||
var copyOptions = { | ||
encoding: options.encoding, | ||
process: processFile, | ||
noProcess: options.noProcess || options.processContentExclude, | ||
}; | ||
//Adding provided modules | ||
if (options.modules){ | ||
modules = options.modules; | ||
} | ||
//saving destination directory | ||
dstDir = options.dstDir; | ||
var options = this.options({ | ||
encoding: grunt.file.defaultEncoding, | ||
// processContent/processContentExclude deprecated renamed to process/noProcess | ||
processContent: false, | ||
processContentExclude: [], | ||
mode: false | ||
}); | ||
var dest; | ||
var tally = { | ||
dirs: 0, | ||
files: 0 | ||
}; | ||
var copyOptions = { | ||
encoding: options.encoding, | ||
process: processFile, | ||
noProcess: options.noProcess || options.processContentExclude, | ||
}; | ||
//Adding provided modules | ||
if (options.modules){ | ||
modules = ["main"].concat(options.modules); | ||
var copyFunction =function(src, dst, isExpandedPair){ | ||
if (detectDestType(dst) === 'directory') { | ||
dstpath = dest = (isExpandedPair) ? dst : unixifyPath(path.join(dst, src)); | ||
} else { | ||
dstpath = dest = dst; | ||
} | ||
//saving destination directory | ||
dstDir = options.dstDir; | ||
var dest; | ||
var tally = { | ||
dirs: 0, | ||
files: 0 | ||
}; | ||
var copyFunction =function(src, dst, isExpandedPair){ | ||
if (detectDestType(dst) === 'directory') { | ||
dstpath = dest = (isExpandedPair) ? dst : unixifyPath(path.join(dst, src)); | ||
} else { | ||
dstpath = dest = dst; | ||
} | ||
if (grunt.file.isDir(src)) { | ||
grunt.verbose.writeln('Creating ' + dest.cyan); | ||
grunt.file.mkdir(dest); | ||
tally.dirs++; | ||
} else { | ||
grunt.verbose.writeln('Copying ' + src.cyan + ' -> ' + dest.cyan); | ||
grunt.file.copy(src, dest, copyOptions); | ||
if (options.mode !== false) { | ||
fs.chmodSync(dest, (options.mode === true) ? fs.lstatSync(src).mode : options.mode); | ||
} | ||
tally.files++; | ||
} | ||
if (grunt.file.isDir(src)) { | ||
} | ||
grunt.verbose.writeln('Creating ' + dest.cyan); | ||
grunt.file.mkdir(dest); | ||
tally.dirs++; | ||
} else { | ||
grunt.verbose.writeln('Copying ' + src.cyan + ' -> ' + dest.cyan); | ||
grunt.file.copy(src, dest, copyOptions); | ||
if (options.mode !== false) { | ||
fs.chmodSync(dest, (options.mode === true) ? fs.lstatSync(src).mode : options.mode); | ||
} | ||
tally.files++; | ||
} | ||
this.files.forEach(function (filePair) { | ||
var isExpandedPair = filePair.orig.expand || false; | ||
} | ||
for (var i in modules) { | ||
filePair.src.forEach(function (src) { | ||
this.files.forEach(function (filePair) { | ||
var isExpandedPair = filePair.orig.expand || false; | ||
var dstModulePath = dstDir + "/" + modules[i] + "/" + src; | ||
copyFunction(src, dstModulePath, isExpandedPair); | ||
for (var i in modules) { | ||
filePair.src.forEach(function (src) { | ||
}); | ||
} | ||
}); | ||
var dstModulePath = dstDir + "/" + modules[i] + "/" + src; | ||
copyFunction(src, dstModulePath, isExpandedPair); | ||
if (tally.dirs) { | ||
grunt.log.write('Created ' + tally.dirs.toString().cyan + ' directories'); | ||
} | ||
}); | ||
} | ||
}); | ||
if (tally.files) { | ||
grunt.log.write((tally.dirs ? ', copied ' : 'Copied ') + tally.files.toString().cyan + ' files'); | ||
} | ||
if (tally.dirs) { | ||
grunt.log.write('Created ' + tally.dirs.toString().cyan + ' directories'); | ||
} | ||
if (tally.files) { | ||
grunt.log.write((tally.dirs ? ', copied ' : 'Copied ') + tally.files.toString().cyan + ' files'); | ||
} | ||
grunt.log.writeln(); | ||
grunt.log.writeln(); | ||
}); | ||
@@ -258,2 +255,2 @@ | ||
}; | ||
}; |
20726
296