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

Use regexps with '/g' modifier to replace all matches of built-in vars. #218

Merged
merged 1 commit into from
Nov 4, 2015

Conversation

nsf
Copy link
Contributor

@nsf nsf commented Nov 3, 2015

As far as I understand javascript's "replace" with string arguments does only single replacement. I needed to replace all matches when building some of the Go projects. The use case was to redefine an environment variable like so: "GOPATH": "{PROJECT_PATH}:{PROJECT_PATH}/vendor". With this fix it actually works.

@noseglid
Copy link
Owner

noseglid commented Nov 4, 2015

Cool. Thanks!

noseglid added a commit that referenced this pull request Nov 4, 2015
Use regexps with '/g' modifier to replace all matches of built-in vars.
@noseglid noseglid merged commit 7a5c9f9 into noseglid:master Nov 4, 2015
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

Successfully merging this pull request may close these issues.

2 participants