Comments (16)
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.
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.
Right - I would expect **
(or **/*.js
) to work; they do not. The presence or absence of quotes doesn't change the result.
from renamer.
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.
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.
are there any sym-linked directories under src
?
from renamer.
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.
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.
ok.. which version of Windows you on @tekmaven ?
from renamer.
Windows 7. I can try this tonight on 8 if you would like to see if there is a difference.
from renamer.
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.
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.
@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.
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.
Yes, I do.
from renamer.
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)
- Regexp finishes after first group HOT 3
- Dry-run doesn't log anything HOT 5
- Broken on node v12 HOT 1
- using renamer within nodejs app HOT 1
- Can't able to add exclude directory in files options Array HOT 2
- Can't able use it as global node package HOT 1
- Compatibility with yarn pnp? HOT 7
- Is there any way to only rename the files without renaming directories? HOT 1
- option to only log summary HOT 3
- Unknown option: --regex HOT 2
- Preset the naming method of some files or directories? HOT 6
- Regex issue with Git Bash on Windows HOT 5
- Regex /^$/ can't work HOT 5
- Make the resulting operation (e.g. rename, copy, git mv etc) user-definable HOT 1
- escaping hifen HOT 2
- Error with files starting with "." (dot) HOT 1
- --git flag? HOT 1
- FR: typescript support HOT 1
- Add --skip option (opposite of --force)
- Strange output HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from renamer.