diff --git a/lib/tessel/deploy.js b/lib/tessel/deploy.js index 62835225..29ef9f73 100644 --- a/lib/tessel/deploy.js +++ b/lib/tessel/deploy.js @@ -311,7 +311,7 @@ actions.tarBundle = function(opts) { if (opts.slim) { logs.info('Generating slim build.'); return new Promise(function(resolve, reject) { - actions.glob(target + '/**/*.tesselignore', { + actions.glob(target + path.normalize('/**/*.tesselignore'), { dot: true, mark: true, }, function(error, ignoreFiles) { @@ -334,13 +334,14 @@ actions.tarBundle = function(opts) { return rules.concat(patterns); }, []).map(function(rule) { - + // Ensure it uses proper paths for OS + rule = path.normalize(rule); if (rule[rule.length - 1] === '/') { - rule += '**/*.*'; + rule += path.normalize('**/*.*'); } if (rule[rule.length - 1] !== '*' && rule.indexOf('.') === -1) { - rule += '/**/*.*'; + rule += path.normalize('/**/*.*'); } return rule; diff --git a/test/unit/deploy.js b/test/unit/deploy.js index cc4416ce..ecec983e 100644 --- a/test/unit/deploy.js +++ b/test/unit/deploy.js @@ -387,17 +387,17 @@ exports['tarBundle'] = { // The comment line MUST NOT create a pattern entry. test.equal(this.globSync.callCount, 4); test.deepEqual(this.globSync.args, [ - ['a/**/*.*', { - cwd: 'test/unit/fixtures/ignore' + [path.normalize('a/**/*.*'), { + cwd: path.normalize('test/unit/fixtures/ignore') }], - ['mock-foo.js', { - cwd: 'test/unit/fixtures/ignore' + [path.normalize('mock-foo.js'), { + cwd: path.normalize('test/unit/fixtures/ignore') }], - ['nested/b/**/*.*', { - cwd: 'test/unit/fixtures/ignore' + [path.normalize('nested/b/**/*.*'), { + cwd: path.normalize('test/unit/fixtures/ignore') }], - ['nested/file.js', { - cwd: 'test/unit/fixtures/ignore' + [path.normalize('nested/file.js'), { + cwd: path.normalize('test/unit/fixtures/ignore') }] ]);