1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

yarn: Fix handling of empty outdated & scoped packages (#474)

* Fixed index out of range in yarn module when no packages are outdated

* Fixed handling of yarn dependencies when scoped modules are installed

* Added changelog fragment for yarn module fixes

* Adhere changelogs/fragments/474-yarn_fix-outdated-fix-list.yml to current standards

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Added scoped package to yarn integration test

Co-authored-by: Jan Gaßner <jan.gassner@plusserver.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Jan Gaßner 2020-07-23 09:19:32 +02:00 committed by GitHub
parent 80cd8329e0
commit eb2369a934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- yarn - fixed an index out of range error when no outdated packages where returned by yarn executable (see https://github.com/ansible-collections/community.general/pull/474).
- yarn - fixed an too many values to unpack error when scoped packages are installed (see https://github.com/ansible-collections/community.general/pull/474).

View file

@ -243,7 +243,7 @@ class Yarn(object):
return installed, missing
for dep in dependencies:
name, version = dep['name'].split('@')
name, version = dep['name'].rsplit('@', 1)
installed.append(name)
if self.name not in installed:
@ -274,6 +274,9 @@ class Yarn(object):
if err:
self.module.fail_json(msg=err)
if not cmd_result:
return outdated
outdated_packages_data = cmd_result.splitlines()[1]
data = json.loads(outdated_packages_data)

View file

@ -3,6 +3,7 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"iconv-lite": "^0.4.21"
"iconv-lite": "^0.4.21",
"@types/node": "^12.0.0"
}
}