From 253384c3045f3724b681e05b6f6a687d33df5893 Mon Sep 17 00:00:00 2001 From: Kamil Bukum Date: Thu, 14 Nov 2024 16:37:53 -0800 Subject: [PATCH] add comment for installed_version --- npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb b/npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb index bcb418c3784..8a5b6728957 100644 --- a/npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb +++ b/npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb @@ -310,6 +310,10 @@ def install(name, version) Dependabot.logger.info("Installed version of #{name}: #{installed_version(name)}") end + # Retrieve the installed version of the package manager by executing + # the " --version" command and using the output. + # If the output does not match the expected version format (PACKAGE_MANAGER_VERSION_REGEX), + # fall back to the version inferred from the dependency files. sig { params(name: T.nilable(String)).returns(String) } def installed_version(name) # Return the memoized version if it has already been computed