Skip to content
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
Copy Markdown
Contributor

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
Copy Markdown
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(/\$\{.*?\}/, ""))
end
dirs.pop
end
end
Expand Down