Comments (2)
I'm afraid that I'm unable to reproduce this problem. Are you able to give me something more definitive that I can reproduce it with?
from replace-x.
I'm able to reproduce this. It looks like the script is taking the replacement string as one of the paths to look for files:
$ npm i replace-x
$ npx replace-x --version
1.7.2
$ echo 'this file has text' > test.txt
$ cat test.txt
this file has text
$ npx replace-x 'text' 'TEXT BUT UPPERCASE' test.txt
ENOENT: no such file or directory, lstat 'TEXT BUT UPPERCASE'
I was able to fix it by adding the replacement
property to shared-options
:
replacement: {
position: 1, // Second argument
string: true,
describe: 'Replacement string for matches',
demandOption: true,
}
At the same time, the paths
property has a wrong index of 1
when it should be 2
(third argument):
replace-x/bin/shared-options-x.js
Line 12 in 7770104
It also looks like positionalArgs
being an object is a problem for the parser that is looking for an array:
replace-x/bin/parse-arguments-x.js
Line 6 in 7770104
After those fixes, I was able to run the script successfully:
$ echo 'some random TEXT' > test.txt
$ cat test.txt
some random TEXT
$ npx replace-x 'TEXT' 'text, but lowercase' test.txt
test.txt
1: some random text, but lowercase
$ cat test.txt
some random text, but lowercase
I hope this helps you to publish a fix.
from replace-x.
Related Issues (4)
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 replace-x.