Permalink
Browse files

debug

  • Loading branch information...
openhoat committed Mar 5, 2013
1 parent 2ad298e commit 91adcb43c7a07862c173081c0d0a6be9999ca19f
Showing with 7 additions and 2 deletions.
  1. +1 −1 package.json
  2. +6 −1 tasks/crypt.js
View
@@ -1,6 +1,6 @@
{
"name":"grunt-contrib-crypt",
- "version":"0.0.9",
+ "version":"0.1.0",
"description":"Encrypt / decrypt files",
"homepage":"https://github.com/openhoat/grunt-contrib-crypt",
"main":"Gruntfile.js",
View
@@ -1,6 +1,11 @@
var path = require('path')
+ , fs = require('fs')
, kruptosUtilCrypt = require('../node_modules/kruptos/lib/kruptos-util-crypt');
+function isFileAndNotInModules(file) {
+ return file.indexOf('node_modules/') !== 0 && fs.lstatSync(file).isFile();
+}
+
module.exports = function (grunt) {
"use strict";
grunt.registerTask('encrypt', 'Encrypt files and folders', function () {
@@ -39,7 +44,7 @@ module.exports = function (grunt) {
files.forEach(function (file) {
var srcDir = file.dir || 'src'
, encryptedExtension = file.encryptedExtension || '.encrypted'
- , filePaths = grunt.file.expand({ filter:'isFile', cwd:srcDir }, '**/*' + encryptedExtension);
+ , filePaths = grunt.file.expand({ filter:isFileAndNotInModules, cwd:srcDir }, '**/*' + encryptedExtension);
filePaths.forEach(function (filePath) {
var srcFilePath = path.join(srcDir, filePath)
, destFilePath = srcFilePath.substring(0, srcFilePath.length - encryptedExtension.length)

0 comments on commit 91adcb4

Please sign in to comment.