Closed erquhart closed 9 years ago
you don't need to write **/**/**/**
- the expression **
means all subdirectories, no matter how deep..
so your expression should be "**/*.js"
or similar - you only need the **
once.. don't forget to enclose the expression in quotes, to prevent bash attempting filename expansion on it.
Right - I would expect **
(or **/*.js
) to work; they do not. The presence or absence of quotes doesn't change the result.
and you're running the tool where? in cygwin for windows? which OS?
can you paste the full command you are running?
On 12 Jun 2015, at 16:32, Shawn Erquhart notifications@github.com wrote:
Right - I would expect * (or /.js) to work; they do not. The presence or absence of quotes doesn't make a difference.
— Reply to this email directly or view it on GitHub.
For example, given this command: renamer --find test.js --replace spec.js 'src/**'
, a matching file that is not in the src directory will not be renamed. If that file is four levels down, the following command is needed to rename the file: renamer --find test.js --replace spec.js 'src/**/**/**/*.js'
.
I'm on Windows using mingw, similar to cygwin. Again, globbing works as expected everywhere else from the bash.
are there any sym-linked directories under src
?
No.
On Fri, Jun 12, 2015 at 9:32 AM -0700, "Lloyd Brookes" notifications@github.com wrote:
are there any sym-linked directories under src?
— Reply to this email directly or view it on GitHub.
I can actually also confirm this. Globbing does not work properly when I execute from Windows Command Prompt. When I execute from Git Bash (which is mingw32 bash), it works. This actually helped me out!
ok.. which version of Windows you on @tekmaven ?
Windows 7. I can try this tonight on 8 if you would like to see if there is a difference.
No need, I'm on Windows 8.
@tekmaven are you saying globstar is working probably in mingw32 bash? That's what I'm using, and an additional globstar is required for each nested level.
I'm downloading a fresh Win8.1 VM now to debug this on.. i have a feeling it's an issue in the underlying glob library (which was recently updated), we'll soon see..
@erquhart I was just trying to do \ (everything) and it worked fine for me. It did not work at all under cmd.exe
.
could you run this test please and let me know the output? the test files are here.
run these commands at the terminal (cmd, bash, whatever)
$ git clone https://gist.github.com/6b944fcd75836e8de2d6.git renamer-test
$ cd renamer-test
$ npm install
$ node create-files.js
$ npm test
do you get this output?
Dry run
√ one\file1.txt -> one\file1.yeah
√ one\file2.txt -> one\file2.yeah
√ one\file3.txt -> one\file3.yeah
√ one\two\file1.txt -> one\two\file1.yeah
√ one\two\file2.txt -> one\two\file2.yeah
√ one\two\file3.txt -> one\two\file3.yeah
√ one\two\three\file1.txt -> one\two\three\file1.yeah
√ one\two\three\file2.txt -> one\two\three\file2.yeah
√ one\two\three\file3.txt -> one\two\three\file3.yeah
Yes, I do.
Here is the output:
C:\Temp\test\renamer-test>npm test
> renamer-test@1.0.0 test C:\Temp\test\renamer-test
> renamer -f .txt -r .yeah -d one/**
Dry run
√ one\file1.txt -> one\file1.yeah
√ one\file2.txt -> one\file2.yeah
√ one\file3.txt -> one\file3.yeah
√ one\two\file1.txt -> one\two\file1.yeah
√ one\two\file2.txt -> one\two\file2.yeah
√ one\two\file3.txt -> one\two\file3.yeah
√ one\two\three\file1.txt -> one\two\three\file1.yeah
√ one\two\three\file2.txt -> one\two\three\file2.yeah
√ one\two\three\file3.txt -> one\two\three\file3.yeah
ok, so basic recursion is working.. using this one/two/three
folder structure can you send me a command which demonstrates it failing? Cheers!
To get recursion, I have to add an additional
/**
per directory level. So for a directory nested four levels in, I have to target**/**/**/**
. Is this expected behavior? I'm on Windows, but I do everything in the bash - globbing always works as expected.