diff --git a/lib/deployer.js b/lib/deployer.js index 97740ce..749be4e 100644 --- a/lib/deployer.js +++ b/lib/deployer.js @@ -119,7 +119,7 @@ module.exports = function(args) { const mapFn = function(dir) { const opts = {}; const extendPath = pathFn.join(baseDir, dir); - const extendDist = pathFn.join(deployDir, dir); + const extendDist = pathFn.join(deployDir, pathFn.basename(dir)); if (typeof ignoreHidden === 'object') { opts.ignoreHidden = ignoreHidden[dir]; diff --git a/test/deployer.js b/test/deployer.js index 6c34935..d09f480 100644 --- a/test/deployer.js +++ b/test/deployer.js @@ -118,6 +118,30 @@ describe('deployer', () => { }); }); + it('extend dirs - relative path', () => { + const extendDirInput = '../extendAsset'; + const extendDir = pathFn.join(baseDir, extendDirInput); + const extendDirName = pathFn.basename(extendDir); + + return fs.writeFile(pathFn.join(extendDir, 'extR.txt'), 'relative') + .then(() => { + return deployer({ + repo: fakeRemote, + extend_dirs: extendDirInput, + silent: true + }); + }).then(() => { + return validate(); + }).then(() => { + const extTxtFile = pathFn.join(validateDir, extendDirName, 'extR.txt'); + + return fs.readFile(extTxtFile); + }).then(content => { + content.should.eql('relative'); + return fs.rmdir(extendDir); + }); + }); + it('multi deployment', () => { return deployer({ repo: {