node-sync-glob icon indicating copy to clipboard operation
node-sync-glob copied to clipboard

Spaces in source path?

Open david-hollifield opened this issue 7 years ago • 9 comments

Is there any way to have a space in the source path? For example:

sync-glob '../my stuff/src/shared/**/*' src/shared

fails at "../my"

david-hollifield avatar Dec 19 '17 20:12 david-hollifield

@david-hollifield never tested a space case. Need to add test spec for that too.

AndyOGo avatar Dec 19 '17 20:12 AndyOGo

"space case" LOL!

david-hollifield avatar Dec 19 '17 20:12 david-hollifield

@david-hollifield Did you try to escape the space? Note: Double escape may be needed (so that one slash goes through the shell environment down to node...). sync-glob '../my\\ stuff/src/shared/**/*' src/shared

AndyOGo avatar Dec 22 '17 00:12 AndyOGo

@david-hollifield I just added a test at #50 Works for me locally, let's see how CI tests turn out to be... Though I really think you just need to escape stuff.

AndyOGo avatar Dec 22 '17 00:12 AndyOGo

@david-hollifield Running the following commands in my CLI manually works too:

Space in source glob node ./bin/sync-glob.js 'test/mock/foo space/*.txt' tmp/copy

DELETE tmp/copy COPY test/mock/foo space/a.txt to tmp/copy/a.txt COPY test/mock/foo space/b.txt to tmp/copy/b.txt

Space in source glob and target dir node ./bin/sync-glob.js 'test/mock/foo space/*.txt' tmp/co\ py

DELETE tmp/co py COPY test/mock/foo space/a.txt to tmp/co py/a.txt COPY test/mock/foo space/b.txt to tmp/co py/b.txt

Relative Path with space node ./bin/sync-glob.js '../node-sync-glob/test/mock/foo space/*.txt' tmp/co\ py2

DELETE tmp/co py2 COPY test/mock/foo space/a.txt to tmp/co py2/a.txt COPY test/mock/foo space/b.txt to tmp/co py2/b.txt

The CLI screen shot 2017-12-22 at 01 30 43

Finder screen shot 2017-12-22 at 01 28 28

AndyOGo avatar Dec 22 '17 00:12 AndyOGo

@david-hollifield All checks passed at Linux, MacOS and windows for various node versions. Check out PR #50

Thanks for raising this question, it increased my test coverage:)

AndyOGo avatar Dec 22 '17 10:12 AndyOGo

@AndyOGo I'm not sure what I'm doing wrong, but after updating to 1.3.8 and running with and without escaping the space I get the attached. Any ideas?

2017-12-22_14-28-15

david-hollifield avatar Dec 22 '17 19:12 david-hollifield

@david-hollifield Thanks for your detailed feedback. Well, that seems obviously to be a bug. I will add another test with nested stuff within a directory which contains spaces.

Then after chrismas I will track that one down. Thanks again for your welcome feedback. A merry xmas and a happy new year.

AndyOGo avatar Dec 24 '17 19:12 AndyOGo

Any luck with this one?

david-hollifield avatar Jan 31 '18 14:01 david-hollifield