Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape simple quotes #16

Open
j-catania opened this issue Oct 14, 2021 · 0 comments
Open

Escape simple quotes #16

j-catania opened this issue Oct 14, 2021 · 0 comments

Comments

@j-catania
Copy link

Hi,

I'm having big issue with using this cli in package.json script.
I want to change the version in a JSON file.

Can't escape the simple quote (')

Here is my script:

{
...
"replace:env": "replace-in-files --regex='\\'\\d+\\.\\d+\\.\\d+\\'' --replacement=\\'$npm_package_version\\' src/environments/environment.prod.ts src/environments/environment.ts",
}

And the return :

> replace-in-files --regex='\'\d+\.\d+\.\d+\'' --replacement=\'$npm_package_version\' src/environments/environment.prod.ts src/environments/environment.ts

The `--replacement` flag is required

Process finished with exit code 1

Really thanks for your help,
Julien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant