Giter VIP home page Giter VIP logo

Comments (16)

tekmaven avatar tekmaven commented on July 20, 2024 1

Here is the output:

C:\Temp\test\renamer-test>npm test

> [email protected] 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

from renamer.

75lb avatar 75lb commented on July 20, 2024

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.

from renamer.

erquhart avatar erquhart commented on July 20, 2024

Right - I would expect ** (or **/*.js) to work; they do not. The presence or absence of quotes doesn't change the result.

from renamer.

75lb avatar 75lb commented on July 20, 2024

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 [email protected] 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.

from renamer.

erquhart avatar erquhart commented on July 20, 2024

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.

from renamer.

75lb avatar 75lb commented on July 20, 2024

are there any sym-linked directories under src?

from renamer.

erquhart avatar erquhart commented on July 20, 2024

No.

On Fri, Jun 12, 2015 at 9:32 AM -0700, "Lloyd Brookes" [email protected] wrote:

are there any sym-linked directories under src?


Reply to this email directly or view it on GitHub.

from renamer.

tekmaven avatar tekmaven commented on July 20, 2024

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!

from renamer.

75lb avatar 75lb commented on July 20, 2024

ok.. which version of Windows you on @tekmaven ?

from renamer.

tekmaven avatar tekmaven commented on July 20, 2024

Windows 7. I can try this tonight on 8 if you would like to see if there is a difference.

from renamer.

erquhart avatar erquhart commented on July 20, 2024

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.

from renamer.

75lb avatar 75lb commented on July 20, 2024

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..

from renamer.

tekmaven avatar tekmaven commented on July 20, 2024

@erquhart I was just trying to do ** (everything) and it worked fine for me. It did not work at all under cmd.exe.

from renamer.

75lb avatar 75lb commented on July 20, 2024

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

from renamer.

tekmaven avatar tekmaven commented on July 20, 2024

Yes, I do.

from renamer.

75lb avatar 75lb commented on July 20, 2024

ok, so basic recursion is working.. using this one/two/three folder structure can you send me a command which demonstrates it failing? Cheers!

from renamer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.