From 91757f3fbb376f3c93b8160b9f7c628eb7fb3dfd Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 22:54:08 +0200 Subject: [PATCH 01/27] updated dir-compare --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c6b7ea..60d056b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "babel-plugin-transform-object-assign": "^6.8.0", "babel-plugin-transform-object-rest-spread": "^6.16.0", "babel-preset-es2015": "^6.18.0", - "dir-compare": "^1.3.0", + "dir-compare": "^1.4.0", "documentation": "^4.0.0-beta.18", "eslint": "^3.9.1", "eslint-config-airbnb-base": "^9.0.0", From 3cbb50eef6217e6bf560b5d2cedabd84214cec23 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:07:21 +0200 Subject: [PATCH 02/27] just adding logs for testing --- test/sync.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sync.spec.js b/test/sync.spec.js index f056f4f..7325f38 100644 --- a/test/sync.spec.js +++ b/test/sync.spec.js @@ -15,10 +15,12 @@ describe('node-sync-glob watch', () => { done() }, ['watch', 'mirror'], () => { + console.log('append') fs.appendFileSync('tmp/mock/a.txt', 'foobarbaz') }, 'copy', compare(() => { fs.removeSync('tmp/mock/a.txt') + console.log('removed') }), 'remove', () => { expect(fs.existsSync('tmp/sync/a.txt')).toBe(false) From 07848ea00eebc58e732e363460dc058019ef7a41 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:15:34 +0200 Subject: [PATCH 03/27] added args --- test/sync.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/sync.spec.js b/test/sync.spec.js index 7325f38..43a6a5f 100644 --- a/test/sync.spec.js +++ b/test/sync.spec.js @@ -22,7 +22,8 @@ describe('node-sync-glob watch', () => { fs.removeSync('tmp/mock/a.txt') console.log('removed') }), - 'remove', () => { + 'remove', (...args) => { + console.log(args) expect(fs.existsSync('tmp/sync/a.txt')).toBe(false) close() done() From af3371ca02bd1160ec57429f9948b722058bc5bd Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:36:50 +0200 Subject: [PATCH 04/27] console.log bases --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index fe00b86..a54fba8 100644 --- a/src/index.js +++ b/src/index.js @@ -57,6 +57,9 @@ const syncGlob = (sources, target, options = {}, notify = () => {}) => { const notifyError = (err) => { notify('error', err) } const bases = sourcesBases(sources) + + console.log('+++++++++++') + console.log(bases) const resolveTargetFromBases = resolveTarget(bases) const { depth, watch } = options let { transform } = options From 971fa0ece4c42a2016b5565c569c88d4041f02e5 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:46:50 +0200 Subject: [PATCH 05/27] fixing windows path sep --- src/lib/sources-bases.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/sources-bases.js b/src/lib/sources-bases.js index e73aa66..a2d2bf1 100644 --- a/src/lib/sources-bases.js +++ b/src/lib/sources-bases.js @@ -4,6 +4,7 @@ import path from 'path' import isGlob from './is-glob' const reDir = /\/|\\/ +const reDirAll = new RegExp(reDir.source, 'gm') /** * Determine the base paths of `sources` like: @@ -49,7 +50,7 @@ const sourcesBases = (sources) => { } if (bases.indexOf(pattern) === -1) { - bases.push(pattern) + bases.push(pattern.replace(reDirAll, path.sep)) } return bases From e005820e83b67163570aea1c5f55cb3d96e30464 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:49:54 +0200 Subject: [PATCH 06/27] fixed typo --- test/lib/is-glob.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/is-glob.spec.js b/test/lib/is-glob.spec.js index 702cfcf..1f8ace1 100644 --- a/test/lib/is-glob.spec.js +++ b/test/lib/is-glob.spec.js @@ -3,7 +3,7 @@ import isGlob from '../../src/lib/is-glob' // eslint-disable-next-line no-bitwise const isGloby = value => !!~isGlob(value) -describe('lib/is-glib', () => { +describe('lib/is-glob', () => { describe('truthy', () => { it('should match asterisk wildcard', () => { expect(isGloby('*')).toBe(true) From 8b319c40c62c1555ffbea519b1047a2223073516 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:55:22 +0200 Subject: [PATCH 07/27] made test windows compatable --- test/lib/sources-bases.spec.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/test/lib/sources-bases.spec.js b/test/lib/sources-bases.spec.js index 24fbdff..17428fe 100644 --- a/test/lib/sources-bases.spec.js +++ b/test/lib/sources-bases.spec.js @@ -1,17 +1,18 @@ +import { sep } from 'path' import sourcesBases from '../../src/lib/sources-bases' describe('lib/sources-bases', () => { it('should resolve the base path of globs', () => { expect(sourcesBases('*')).toEqual(['']) - expect(sourcesBases('test/mock/*.txt')).toEqual(['test/mock']) - expect(sourcesBases('test/mock/a*txt')).toEqual(['test/mock']) + expect(sourcesBases('test/mock/*.txt')).toEqual([`test${sep}mock`]) + expect(sourcesBases('test/mock/a*txt')).toEqual([`test${sep}mock`]) expect(sourcesBases('test/**/*.txt')).toEqual(['test']) - expect(sourcesBases('test/mock/?.txt')).toEqual(['test/mock']) - expect(sourcesBases('test/mock/a?txt')).toEqual(['test/mock']) + expect(sourcesBases('test/mock/?.txt')).toEqual([`test${sep}mock`]) + expect(sourcesBases('test/mock/a?txt')).toEqual([`test${sep}mock`]) - expect(sourcesBases('test/mock/{@org,foo}/.txt')).toEqual(['test/mock']) + expect(sourcesBases('test/mock/{@org,foo}/.txt')).toEqual([`test${sep}mock`]) expect(sourcesBases('test/[a-z]')).toEqual(['test']) expect(sourcesBases('test/[!a-z]')).toEqual(['test']) @@ -25,15 +26,15 @@ describe('lib/sources-bases', () => { }) it('should resolve the base path of files', () => { - expect(sourcesBases('test/mock/a.txt')).toEqual(['test/mock']) - expect(sourcesBases('test/mock/@org/a.txt')).toEqual(['test/mock/@org']) + expect(sourcesBases('test/mock/a.txt')).toEqual([`test${sep}mock`]) + expect(sourcesBases('test/mock/@org/a.txt')).toEqual([`test${sep}mock/@org`]) }) it('should leave directories unchanged', () => { - expect(sourcesBases('test/mock')).toEqual(['test/mock']) - expect(sourcesBases('test/mock/')).toEqual(['test/mock']) - expect(sourcesBases('test/mock/@org')).toEqual(['test/mock/@org']) - expect(sourcesBases('test/mock/@org/')).toEqual(['test/mock/@org']) + expect(sourcesBases('test/mock')).toEqual([`test${sep}mock`]) + expect(sourcesBases('test/mock/')).toEqual([`test${sep}mock`]) + expect(sourcesBases('test/mock/@org')).toEqual([`test${sep}mock/@org`]) + expect(sourcesBases('test/mock/@org/')).toEqual([`test${sep}mock/@org`]) }) it('should ignore exclude patterns', () => { @@ -55,8 +56,8 @@ describe('lib/sources-bases', () => { }) it('should list common base baths no more than once', () => { - expect(sourcesBases(['test/mock/a.txt', 'test/mock/b.txt'])).toEqual(['test/mock']) - expect(sourcesBases(['test/mock', 'test/mock/'])).toEqual(['test/mock']) + expect(sourcesBases(['test/mock/a.txt', 'test/mock/b.txt'])).toEqual([`test${sep}mock`]) + expect(sourcesBases(['test/mock', 'test/mock/'])).toEqual([`test${sep}mock`]) expect(sourcesBases(['test/*.txt', 'test/*.txt'])).toEqual(['test']) }) }) From b98ea2a9d0c55ad67b417aa2b1398e24e9439b15 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Mon, 10 Apr 2017 23:59:13 +0200 Subject: [PATCH 08/27] dir-compare seems to normalize paths already --- test/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/helpers.js b/test/helpers.js index e6f07c7..233f94b 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -114,7 +114,7 @@ export const compare = (done, source, target, options) => (event, data) => { [source, target] = data } - const res = dirCompare.compareSync(path.normalize(source), path.normalize(target), { + const res = dirCompare.compareSync(source, target, { ...options, compareSize: true, compareContent: true, @@ -134,7 +134,7 @@ export const compare = (done, source, target, options) => (event, data) => { export const compareDir = (done, source, target, options = {}) => (event) => { if (event) { - const res = dirCompare.compareSync(path.normalize(source), path.normalize(target), { + const res = dirCompare.compareSync(source, target, { ...options, compareSize: true, compareContent: true, From 7d6b19108d15225cf2c4bdd50989fcf8e57332f0 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:13:15 +0200 Subject: [PATCH 09/27] just add a test log --- src/lib/fs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/fs.js b/src/lib/fs.js index fa3fc17..ac8d63c 100644 --- a/src/lib/fs.js +++ b/src/lib/fs.js @@ -28,7 +28,11 @@ export const copyFile = (source, target, transform) => new Promise((resolve) => return ensureDir(path.dirname(newTarget)).then(() => writeFile(newTarget, data)) })) } else { - resolve(ensureDir(path.dirname(target)).then(() => copy(source, target))) + resolve(ensureDir(path.dirname(target)).then(() => { + console.log(`##+++*** copy ${source} -> ${target}`) + + return copy(source, target) + })) } }) From e0ba9d043cac6c0b5aaad23f3536a8deb46fa762 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:18:23 +0200 Subject: [PATCH 10/27] log files from glob-all --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a54fba8..d9b670c 100644 --- a/src/index.js +++ b/src/index.js @@ -91,7 +91,12 @@ const syncGlob = (sources, target, options = {}, notify = () => {}) => { // Initial mirror const mirrorInit = [ promisify(globAll)(sources.map(source => (isGlob(source) === -1 - && fs.statSync(source).isDirectory() ? `${source}/**` : source))), + && fs.statSync(source).isDirectory() ? `${source}/**` : source))) + .then((files) => { + console.log(files) + + return files + }), ] if (options.delete) { From 1ba085f3e2af551ddd389d65a8fadb9a335c12be Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:21:14 +0200 Subject: [PATCH 11/27] fixing glob-all not returning normalized matches??? --- src/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index d9b670c..2143615 100644 --- a/src/index.js +++ b/src/index.js @@ -92,11 +92,7 @@ const syncGlob = (sources, target, options = {}, notify = () => {}) => { const mirrorInit = [ promisify(globAll)(sources.map(source => (isGlob(source) === -1 && fs.statSync(source).isDirectory() ? `${source}/**` : source))) - .then((files) => { - console.log(files) - - return files - }), + .then(files => files.map(file => path.normalize(file))), ] if (options.delete) { From 98c5dd43cf40bda0d3ff0a9a452b2bce4ed0f4e1 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:24:10 +0200 Subject: [PATCH 12/27] fixed broken pattern sep normalization on windof --- src/lib/sources-bases.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/sources-bases.js b/src/lib/sources-bases.js index a2d2bf1..329156d 100644 --- a/src/lib/sources-bases.js +++ b/src/lib/sources-bases.js @@ -49,8 +49,10 @@ const sourcesBases = (sources) => { } } + pattern = pattern.replace(reDirAll, path.sep) + if (bases.indexOf(pattern) === -1) { - bases.push(pattern.replace(reDirAll, path.sep)) + bases.push(pattern) } return bases From 5042ac1eb38e88873e883c1aa8cd50c333ba29ff Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:24:56 +0200 Subject: [PATCH 13/27] fixed eslint --- src/lib/sources-bases.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/sources-bases.js b/src/lib/sources-bases.js index 329156d..c93f4c6 100644 --- a/src/lib/sources-bases.js +++ b/src/lib/sources-bases.js @@ -49,6 +49,7 @@ const sourcesBases = (sources) => { } } + // eslint-disable-next-line no-param-reassign pattern = pattern.replace(reDirAll, path.sep) if (bases.indexOf(pattern) === -1) { From c4ccad95698dd1ce6cf3901df4079a91b7bc9115 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:30:07 +0200 Subject: [PATCH 14/27] fixed broken test --- test/lib/sources-bases.spec.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/lib/sources-bases.spec.js b/test/lib/sources-bases.spec.js index 17428fe..2f26d0a 100644 --- a/test/lib/sources-bases.spec.js +++ b/test/lib/sources-bases.spec.js @@ -27,14 +27,14 @@ describe('lib/sources-bases', () => { it('should resolve the base path of files', () => { expect(sourcesBases('test/mock/a.txt')).toEqual([`test${sep}mock`]) - expect(sourcesBases('test/mock/@org/a.txt')).toEqual([`test${sep}mock/@org`]) + expect(sourcesBases('test/mock/@org/a.txt')).toEqual([`test${sep}mock${sep}@org`]) }) it('should leave directories unchanged', () => { expect(sourcesBases('test/mock')).toEqual([`test${sep}mock`]) expect(sourcesBases('test/mock/')).toEqual([`test${sep}mock`]) - expect(sourcesBases('test/mock/@org')).toEqual([`test${sep}mock/@org`]) - expect(sourcesBases('test/mock/@org/')).toEqual([`test${sep}mock/@org`]) + expect(sourcesBases('test/mock/@org')).toEqual([`test${sep}mock${sep}@org`]) + expect(sourcesBases('test/mock/@org/')).toEqual([`test${sep}mock${sep}@org`]) }) it('should ignore exclude patterns', () => { @@ -48,10 +48,10 @@ describe('lib/sources-bases', () => { 'test/mock/@org', 'test/mock/foo/*.txt', ])).toEqual([ - 'test/mock', - 'test/mock/bar', - 'test/mock/@org', - 'test/mock/foo', + `test${sep}mock`, + `test${sep}mock${sep}bar`, + `test${sep}mock${sep}@org`, + `test${sep}mock${sep}foo`, ]) }) From 38626e0b9b888e5e677c451ced70fbac529f7d5d Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:37:18 +0200 Subject: [PATCH 15/27] removed logs --- src/index.js | 3 --- src/lib/fs.js | 6 +----- test/sync.spec.js | 5 +---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index 2143615..fb2a0e8 100644 --- a/src/index.js +++ b/src/index.js @@ -57,9 +57,6 @@ const syncGlob = (sources, target, options = {}, notify = () => {}) => { const notifyError = (err) => { notify('error', err) } const bases = sourcesBases(sources) - - console.log('+++++++++++') - console.log(bases) const resolveTargetFromBases = resolveTarget(bases) const { depth, watch } = options let { transform } = options diff --git a/src/lib/fs.js b/src/lib/fs.js index ac8d63c..fa3fc17 100644 --- a/src/lib/fs.js +++ b/src/lib/fs.js @@ -28,11 +28,7 @@ export const copyFile = (source, target, transform) => new Promise((resolve) => return ensureDir(path.dirname(newTarget)).then(() => writeFile(newTarget, data)) })) } else { - resolve(ensureDir(path.dirname(target)).then(() => { - console.log(`##+++*** copy ${source} -> ${target}`) - - return copy(source, target) - })) + resolve(ensureDir(path.dirname(target)).then(() => copy(source, target))) } }) diff --git a/test/sync.spec.js b/test/sync.spec.js index 43a6a5f..f056f4f 100644 --- a/test/sync.spec.js +++ b/test/sync.spec.js @@ -15,15 +15,12 @@ describe('node-sync-glob watch', () => { done() }, ['watch', 'mirror'], () => { - console.log('append') fs.appendFileSync('tmp/mock/a.txt', 'foobarbaz') }, 'copy', compare(() => { fs.removeSync('tmp/mock/a.txt') - console.log('removed') }), - 'remove', (...args) => { - console.log(args) + 'remove', () => { expect(fs.existsSync('tmp/sync/a.txt')).toBe(false) close() done() From b99bec4e2ad279b7772786ad32646a9ecd3a7f38 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:38:46 +0200 Subject: [PATCH 16/27] added one log for last failing test --- src/lib/fs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/fs.js b/src/lib/fs.js index fa3fc17..d9e6b15 100644 --- a/src/lib/fs.js +++ b/src/lib/fs.js @@ -25,6 +25,8 @@ export const copyFile = (source, target, transform) => new Promise((resolve) => const data = (isObject && transformed.data) || transformed const newTarget = (isObject && transformed.target) || target + console.log(`transform: ${target} -> ${newTarget}`) + return ensureDir(path.dirname(newTarget)).then(() => writeFile(newTarget, data)) })) } else { From 0bf229dcd782887a5189e349980a27cf92ca2421 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:50:10 +0200 Subject: [PATCH 17/27] error log --- src/lib/fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/fs.js b/src/lib/fs.js index d9e6b15..7457543 100644 --- a/src/lib/fs.js +++ b/src/lib/fs.js @@ -25,7 +25,7 @@ export const copyFile = (source, target, transform) => new Promise((resolve) => const data = (isObject && transformed.data) || transformed const newTarget = (isObject && transformed.target) || target - console.log(`transform: ${target} -> ${newTarget}`) + console.error(`transform: ${target} -> ${newTarget}`) return ensureDir(path.dirname(newTarget)).then(() => writeFile(newTarget, data)) })) From 5b0c6b200ccc1cd4fa1978d1d3170a5f9ceda043 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 00:55:06 +0200 Subject: [PATCH 18/27] moar logs --- test/transform.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/transform.spec.js b/test/transform.spec.js index 37ca39e..8a0d7e9 100644 --- a/test/transform.spec.js +++ b/test/transform.spec.js @@ -12,7 +12,8 @@ describe('node-sync-glob transform', () => { close() done() }, - 'mirror', () => { + 'mirror', (...args) => { + console.log(`MIRROR -> ${args}`) expect(fs.existsSync('tmp/trans/b.txt')).toBe(false) expect(fs.existsSync('tmp/trans/b-replaced.txt')).toBe(true) From a0870ac9312f2703f8dac691bb2ef554b6ebe6c3 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:01:01 +0200 Subject: [PATCH 19/27] updated jest --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60d056b..9b95109 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,6 @@ "eslint": "^3.9.1", "eslint-config-airbnb-base": "^9.0.0", "eslint-plugin-import": "^2.0.1", - "jest": "^18.1.0" + "jest": "^19.0.2" } } From 0c1f6de702450e9ac909f30a5c88b3c7225f3f38 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:13:10 +0200 Subject: [PATCH 20/27] removed logs --- src/lib/fs.js | 2 -- test/transform.spec.js | 1 - 2 files changed, 3 deletions(-) diff --git a/src/lib/fs.js b/src/lib/fs.js index 7457543..fa3fc17 100644 --- a/src/lib/fs.js +++ b/src/lib/fs.js @@ -25,8 +25,6 @@ export const copyFile = (source, target, transform) => new Promise((resolve) => const data = (isObject && transformed.data) || transformed const newTarget = (isObject && transformed.target) || target - console.error(`transform: ${target} -> ${newTarget}`) - return ensureDir(path.dirname(newTarget)).then(() => writeFile(newTarget, data)) })) } else { diff --git a/test/transform.spec.js b/test/transform.spec.js index 8a0d7e9..6600df9 100644 --- a/test/transform.spec.js +++ b/test/transform.spec.js @@ -13,7 +13,6 @@ describe('node-sync-glob transform', () => { done() }, 'mirror', (...args) => { - console.log(`MIRROR -> ${args}`) expect(fs.existsSync('tmp/trans/b.txt')).toBe(false) expect(fs.existsSync('tmp/trans/b-replaced.txt')).toBe(true) From 370177f691a97e4a5bcf72e0d36e016807239c55 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:14:37 +0200 Subject: [PATCH 21/27] fixed not checking if active promises are available --- src/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index fb2a0e8..3013ed0 100644 --- a/src/index.js +++ b/src/index.js @@ -148,11 +148,13 @@ const syncGlob = (sources, target, options = {}, notify = () => {}) => { mirrorPromiseAll = null } - activePromises.forEach((promise) => { - promise.cancel() - }) + if (activePromises) { + activePromises.forEach((promise) => { + promise.cancel() + }) - activePromises = null + activePromises = null + } } // Watcher to keep in sync from that From 408b4043c68ae83255cdc39ae70360167ef4905b Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:20:59 +0200 Subject: [PATCH 22/27] adding windows hint --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index c666d9f..40880a6 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,21 @@ To exclude stuff from source just use glob exclusion - `!` prefix, like: } ``` +### Windows + +As [`node-glob`](https://www.npmjs.com/package/glob#windows) and [`node-glob-all`](https://www.npmjs.com/package/glob-all) respectively only support unix style path separators `/`, don't usw windows style `\`. + +> **Please only use forward-slashes in glob expressions.** +> +> Though windows uses either `/` or `\` as its path separator, only `/` +> characters are used by this glob implementation. You must use +>forward-slashes **only** in glob expressions. Back-slashes will always +> be interpreted as escape characters, not path separators. +> +> Results from absolute patterns such as `/foo/*` are mounted onto the +> root setting using `path.join`. On windows, this will by default result +> in `/foo/*` matching `C:\foo\bar.txt`. + ## API Check our [API documentation](./API.md) From 8f3a4a2b5e863020acb787eb7a5f8c48ae71c1f9 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:25:54 +0200 Subject: [PATCH 23/27] uuuups left over --- test/transform.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/transform.spec.js b/test/transform.spec.js index 6600df9..37ca39e 100644 --- a/test/transform.spec.js +++ b/test/transform.spec.js @@ -12,7 +12,7 @@ describe('node-sync-glob transform', () => { close() done() }, - 'mirror', (...args) => { + 'mirror', () => { expect(fs.existsSync('tmp/trans/b.txt')).toBe(false) expect(fs.existsSync('tmp/trans/b-replaced.txt')).toBe(true) From da9d7da9f36d64492901743a8a7f63a8d014f43a Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:41:54 +0200 Subject: [PATCH 24/27] updated CI configs --- .travis.yml | 5 +++++ appveyor.yml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 910d823..b19fb5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,16 @@ os: node_js: - "node" + - "6" + - "5" + - "4" install: - npm install before_script: + - node --version + - npm --version - npm run lint - npm run test diff --git a/appveyor.yml b/appveyor.yml index d875745..d82186b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,8 +5,10 @@ clone_depth: 3 environment: matrix: # node.js - - nodejs_version: "5" + - nodejs_version: "stable" - nodejs_version: "6" + - nodejs_version: "5" + - nodejs_version: "4" platform: - x86 From 2c4f87952e9b2f175877ce0f937d0f894ed4c7e2 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:48:20 +0200 Subject: [PATCH 25/27] added appveyor badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 40880a6..6320d5f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://travis-ci.org/AndyOGo/node-sync-glob.svg?branch=master)](https://travis-ci.org/AndyOGo/node-sync-glob) +[![Build status](https://ci.appveyor.com/api/projects/status/9i48hbtrfsy5sk1m/branch/master?svg=true)](https://ci.appveyor.com/project/AndyOGo/node-sync-glob/branch/master) + Synchronize files and folders locally by glob patterns, watch option included. ## Install From abae8be34ffd35c5158103a4f9fdeec8209e6466 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 01:50:54 +0200 Subject: [PATCH 26/27] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6320d5f..883bce4 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ To exclude stuff from source just use glob exclusion - `!` prefix, like: ### Windows -As [`node-glob`](https://www.npmjs.com/package/glob#windows) and [`node-glob-all`](https://www.npmjs.com/package/glob-all) respectively only support unix style path separators `/`, don't usw windows style `\`. +As [`node-glob`](https://www.npmjs.com/package/glob#windows) and [`node-glob-all`](https://www.npmjs.com/package/glob-all) respectively only support unix style path separators `/`, don't use windows style `\`. > **Please only use forward-slashes in glob expressions.** > From 65bd66a1b73ce3a38a29261eb3a748bdb90d3d0a Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Tue, 11 Apr 2017 02:40:09 +0200 Subject: [PATCH 27/27] tell travis to wait --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b19fb5a..50d4c5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ node_js: - "4" install: - - npm install + - travis_wait npm install before_script: - node --version