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

Remove duplicates from the library list #1632

Merged
merged 3 commits into from
Nov 18, 2023
Merged

Conversation

worksofliam
Copy link
Contributor

Changes

When .env is used, or when the runCommand API is used, it's possible for the user or code to pass in duplicate libraries, which the IBM i doesn't like too much. This is a simple change to remove duplicates from the end of the library list.

Checklist

  • have tested my change
  • updated relevant documentation
  • Remove any/all console.logs I added
  • eslint is not complaining
  • have added myself to the contributors' list in CONTRIBUTING.md
  • for feature PRs: PR only includes one feature enhancement.

@worksofliam worksofliam linked an issue Nov 6, 2023 that may be closed by this pull request
@worksofliam worksofliam added this to the 2.5.0 release milestone Nov 17, 2023
Comment on lines 520 to 523
ileSetup.libraryList = ileSetup.libraryList
.filter((item, pos, self) => {
return self.indexOf(item) == pos;
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

For the sake of reusing the Tools at hand :)

Suggested change
ileSetup.libraryList = ileSetup.libraryList
.filter((item, pos, self) => {
return self.indexOf(item) == pos;
})
ileSetup.libraryList = ileSetup.libraryList.filter(Tools.distinct);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I did not even know we had that. Fab!!

Copy link
Collaborator

@sebjulliand sebjulliand left a comment

Choose a reason for hiding this comment

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

Just me nitpicking ;)

Copy link
Collaborator

@sebjulliand sebjulliand left a comment

Choose a reason for hiding this comment

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

Nice! Let's merge!

@sebjulliand sebjulliand merged commit 9843e2d into master Nov 18, 2023
@sebjulliand sebjulliand deleted the fix/libl_remove_dupes branch November 18, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dupes from library list?
2 participants