bm-email-templatizer
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -11,3 +11,4 @@ var path = require('path'), | ||
paths = settings.paths | ||
fullPath = path.join( paths.base, paths.locales, activeLocale); | ||
fullPath = path.join( paths.base, activeLocale ); | ||
return new Promise(function(resolve, reject) { | ||
@@ -22,3 +23,3 @@ fs.readFile(fullPath, 'utf8', function(err, file) { | ||
}; | ||
return resolve(parsedObj); | ||
@@ -50,3 +51,5 @@ }) | ||
fs.writeFile(fullPath+'/'+fileName, data.juiced, function(error) { | ||
var destFile = path.join(fullPath, fileName); | ||
fs.writeFile(destFile, data.juiced, function(error) { | ||
if (error) return reject(error), false; | ||
@@ -53,0 +56,0 @@ resolve({'HtmlPath': fullPath}); |
@@ -16,3 +16,3 @@ var extend = require('./extend-mixin'), | ||
scss: 'scss/index.scss', | ||
locales: 'locales/**/*.json', | ||
locales: 'locales/*.json', | ||
views: 'views/**/*.pug', | ||
@@ -19,0 +19,0 @@ compiled: 'compiled/' |
{ | ||
"name": "bm-email-templatizer", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "create email templates through jade/pug, sass, and locale json files", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -18,3 +18,3 @@ var path = require('path'), | ||
activeFile: 'views/basic.pug', | ||
activeLocale: 'en.json' | ||
activeLocale: 'i18n-locales/en.json' | ||
} | ||
@@ -24,7 +24,7 @@ missingContext = { | ||
activeFile: 'missing.pug', | ||
activeLocale: 'en.json' | ||
activeLocale: 'i18n-locales/en.json' | ||
} | ||
undefinedActiveFileContext = { | ||
paths: global.MochaSetup.paths, | ||
activeLocale: 'en.json' | ||
activeLocale: 'i18n-locales/en.json' | ||
} | ||
@@ -31,0 +31,0 @@ }); |
@@ -6,4 +6,3 @@ var path = require('path'), | ||
chaiAsPromised = require('chai-as-promised'), | ||
expect = chai.expect, | ||
jsonLocale = require('../../sample/i18n-locales/en.json'); | ||
expect = chai.expect; | ||
@@ -20,3 +19,3 @@ chai.use(chaiAsPromised); | ||
'paths': global.MochaSetup.paths, | ||
'activeLocale': 'en.json' | ||
'activeLocale': 'i18n-locales/en.json' | ||
}; | ||
@@ -70,4 +69,4 @@ | ||
it('takes context from `this`', function() { | ||
var readFile = readActiveLocale.call(context) | ||
return expect(readFile).to.eventually.deep.equal(jsonLocale); | ||
var readFile = readActiveLocale.call(context); | ||
return expect(readFile).to.eventually.have.property("testString", "English Text"); | ||
}); | ||
@@ -74,0 +73,0 @@ |
19967