The Wayback Machine - http://web.archive.org/web/20200708160813/https://github.com/shelljs/shelljs/issues/965
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

Sed is applied only once by line #965

Open
rubenofen opened this issue Sep 24, 2019 · 2 comments
Open

Sed is applied only once by line #965

rubenofen opened this issue Sep 24, 2019 · 2 comments

Comments

@rubenofen
Copy link

@rubenofen rubenofen commented Sep 24, 2019

Node version (or tell us if you're using electron or some other framework):

12.1.0

ShellJS version (the most recent version/Github branch you see the bug on):

0.8.3

Operating system:

Windows

Description of the bug:

sed is applied only once by line:
original archive:
import [COMPONENTNAME]Base from './[COMPONENTNAME]Base';
const [COMPONENTNAME] = styled( [COMPONENTNAME]Base );
export default [COMPONENTNAME];

after execute:
shell.sed( '-i', \[${"componentname".toUpperCase()}\], "AUITest", "component.js" );`

Result:
import AUITestBase from './[COMPONENTNAME]Base';
const AUITest = styled( [COMPONENTNAME]Base );
export default AUITest;

@nfischer
Copy link
Member

@nfischer nfischer commented Sep 24, 2019

You need to use /regex/g, not /regex/. This is working as intended, but I realized the documentation is poor. I'm open to documentation suggestions.

@rubenofen
Copy link
Author

@rubenofen rubenofen commented Oct 8, 2019

Thank you ;)

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.