package module: counting non-system packages with a custom shell script
#2021
rsenna
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋🏽
New fastfetch user here. Really liking the tool.
I was trying to show a new record with totals for some "custom" package managers I'm using, based on this past discussion.
Note
The example shown in the link above has a small bug for the
npmpackage count.Since that shell snippet is based on directories, it might show wrong values if you have ever uninstalled global packages.
That's why it's best to use the tool itself (
npm) to list and count packages, like I'm doing in the snippet below.So I wrote a (not so) small nushell script to provide it for a couple of package managers -
asdf,npmanduvin my case - but which can easily be extended (or rewritten in another shell such as bash, zsh, fish, if you prefer...):EDIT: moved code to a gist.
Beta Was this translation helpful? Give feedback.
All reactions