From 517047bbf6453a5712476c8ae1fed098856f0e3b Mon Sep 17 00:00:00 2001 From: Richard Kimber Date: Mon, 16 May 2016 12:20:10 +0100 Subject: [PATCH 1/3] Force unix style path seperators in precompile --- src/precompile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/precompile.js b/src/precompile.js index 68f87744..54b49ec3 100644 --- a/src/precompile.js +++ b/src/precompile.js @@ -88,6 +88,8 @@ function precompile(input, opts) { for(var i=0; i Date: Tue, 17 May 2016 07:38:32 +0100 Subject: [PATCH 2/3] Switched path sep replace, to use Regex --- src/precompile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/precompile.js b/src/precompile.js index 54b49ec3..f558aeb3 100644 --- a/src/precompile.js +++ b/src/precompile.js @@ -88,7 +88,7 @@ function precompile(input, opts) { for(var i=0; i Date: Wed, 18 May 2016 20:14:16 +0100 Subject: [PATCH 3/3] Added test to confirm that path seperators are always *NIX, irrespective of precompiling platform --- tests/precompile.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/precompile.js b/tests/precompile.js index 0cfc6c18..d435c754 100644 --- a/tests/precompile.js +++ b/tests/precompile.js @@ -18,5 +18,19 @@ it('should return a string', function() { expect(precompileString('{{ test }}', { name: 'test.j2' })).to.be.an('string'); }); + + describe('templates', function() { + it('should return *NIX path seperators', function() { + var fileName; + + precompile('./tests/templates/item.j2', { + wrapper: function(templates) { + fileName = templates[0].name; + } + }); + + expect(fileName).to.not.contain('\\'); + }); + }); }); })();