mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
[PR #7339/39895a6d backport][stable-7] pnpm: version should not be latest when state is latest (#7347)
pnpm: version should not be latest when state is latest (#7339)
* (fix) don't set version at latest at state: latest
If version is forcefully set at latest when state is latest, the package
will always be changed, as there is no version "latest" will ever be
detected. It is better to keep it None.
* (fix) fixed tests to reflect recent changes
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* (feat) added changelog fragment for pull #7339
* (fix) apply correct punctuation to changelog
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 39895a6d38
)
Co-authored-by: Aritra Sen <125266845+aretrosen@users.noreply.github.com>
This commit is contained in:
parent
625d22391f
commit
b279694779
4 changed files with 23 additions and 10 deletions
|
@ -189,6 +189,8 @@ class Pnpm(object):
|
|||
self.alias_name_ver = (self.alias_name_ver or "") + self.name
|
||||
if self.version is not None:
|
||||
self.alias_name_ver = self.alias_name_ver + "@" + str(self.version)
|
||||
else:
|
||||
self.alias_name_ver = self.alias_name_ver + "@latest"
|
||||
|
||||
def _exec(self, args, run_in_check_mode=False, check_rc=True):
|
||||
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
|
||||
|
@ -413,9 +415,6 @@ def main():
|
|||
if state == "absent" and name is None:
|
||||
module.fail_json(msg="Package name is required for uninstalling")
|
||||
|
||||
if state == "latest":
|
||||
version = "latest"
|
||||
|
||||
if globally:
|
||||
_rc, out, _err = module.run_command(executable + ["root", "-g"], check_rc=True)
|
||||
path, _tail = os.path.split(out.strip())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue