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

Fixing Yarn1 erroring with failed to replace env #7767

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ def clean_npmrc_in_path(yarn_lock)
dirs.pop
while dirs.any?
npmrc = dirs.join("/") + "/.npmrc"
break unless File.exist?(npmrc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this was breaking and not walking through the entire dirs right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the subdir did not contain the .npmrc file then it was breaking out. In such case if the repo root dir still had .npmrc file then error was getting raised.


File.write(npmrc, File.read(npmrc).gsub(/\$\{.*\}/, ""))
if File.exist?(npmrc)
# If the .npmrc file exists, clean it
File.write(npmrc, File.read(npmrc).gsub(/\$\{.*?\}/, ""))
deivid-rodriguez marked this conversation as resolved.
Show resolved Hide resolved
end
dirs.pop
end
end
Expand Down
Loading