Skip to content

Add Support for Multiple Font Names in install.sh - #2086

Merged
Finii merged 22 commits into
ryanoasis:masterfrom
danifbento:feat/install-multiple-font-names
Oct 8, 2026
Merged

Finii merged 22 commits into
ryanoasis:masterfrom
danifbento:feat/install-multiple-font-names

Conversation

@danifbento

@danifbento danifbento commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add the possibility of installing more than one font at time.

  • It's possible to install all
  • It's possible to install 1 font by name
  • It's possible to install N fonts by name
  • It's possible to install 1 font by number

Requirements/Checklist

  • Read the Contributing Guidelines
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan.
    Issue number where discussion took place: #xxx
  • If this contains a font/glyph add its origin as background info below (e.g. URL)
  • Verified the license of any newly added font, glyph, or glyph set. License is: xxx

What does this Pull Request (PR) do?

This PR adds the possibility of installing more that one font at time, using the list of names provided

How should this be manually tested?

Call ./install.sh install with the different combinations of all, Font1 Font2 or number

Any background context you can provide?

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

image image image

@danifbento

Copy link
Copy Markdown
Contributor Author

@all-contributors add danifbento code

@allcontributors

Copy link
Copy Markdown
Contributor

@danifbento

I've put up a pull request to add @danifbento! 🎉

@Finii Finii left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR!

I add some observations below.
There is no need to change the commit (right now), this is mostly about discussing.

Also it would have been nice to use the PR template. As this is already the 2nd or 3rd PR that looks like LLM generated and they all omitted the template I changed the contribution guidelines a bit 😬
(Also no need to change anything here, just for future PRs)

Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread readme.md Outdated
@danifbento

Copy link
Copy Markdown
Contributor Author

Hello, thanks for your feedback.

In fact I only saw the way that descriptions are being done after submitting (looking at other PR, didn't saw the template in the contributors page, maybe my fault I didn't check first). I asked a little help for the description yes 😄 I will change it and improve it.

Regarding other comments, during the day I will try to reply to you and fix them.

Thanks again for your fast feedback!

@Finii

Finii commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

If you change your commit, please also increase the script version

scriptversion="2.0.1"
# Nerd Fonts Version: 3.5.0

# shellcheck enable=require-variable-braces

# This script must run with bash 3
# In fact it is checked against `checkbashisms` and no bashisms are
# used, except (because the workarounds are too involved):
# - Regexes
# - FUNCNAME

To check with checkbashisms mind that you need to remove the ba from bash in the shebang line.

I often forget that myself on script changes, but when someone reports problems with the script this becomes essential.

@danifbento

Copy link
Copy Markdown
Contributor Author

Updated the PR description and fixed some of the suggestions already.

@Finii

Finii commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

I added some more changes :-}
What do you think (we can always also remove commits again)?

@danifbento

Copy link
Copy Markdown
Contributor Author

Thanks, the changes seems to be a big improvement 😄

Thanks for that.

Comment thread install.sh Outdated
# -----------

VERBOSE="${VERBOSE:-1}"
VERBOSE="${VERBOSE:-0}"

@Finii Finii Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔 I can not remember why I did that, but probably it predates the --silent flag, and then we needed to start with 0 (if we can only ADD verbosity).
Yes. Will change the default back to 1 later...

Edit: Fix several typos, I'm in a hurry

@Finii

Finii commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Now we have a lot of options ... I need to stop before featureism creeps in 😬

$ ./install.sh
Usage: install.sh [<options>] <cmd> [<args>]

Install and update Nerd Fonts [1] from the GitHub releases [2].
See `install.sh install --help` for details.

[1] https://www.nerdfonts.com/
[2] https://github.com/ryanoasis/nerd-fonts/releases

cmd:
  help      : show this help message
  env       : show environment
  list      : list released fonts
  install   : selectively install (or update) a font, a list of fonts or *all* fonts
  remove    : uninstall all Nerd Fonts

options:
  -d, --dry             do not execute, show what would happen (pair with -v)
  -r, --release=TAG     specify release tag, default is 'latest'
  -s, --silent          give no progress messages (resets verbose)
  -v, --verbose         increase verbosity level (up to 3 times)
  -z, --zip             use zip archive (needed for older releases)
  -h, --help            show this help message
      --version         show version information

required tools:
  curl mktemp sed tar wc

Hmm, now that I read this, --release TAG could be implemented still...

@Finii

Finii commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Nice nice

I like this now, should we merge?

@danifbento

Copy link
Copy Markdown
Contributor Author

It seems good for me! 👍 Much more complete!

danifbento and others added 16 commits October 8, 2026 20:40
Adding support for install multiple font names using `install.sh`
script. It accept a list of font names and install them in batch.
This method increase functionality as it avoid install 1 or all
only.
Remove bashisms while using bash arrays instead of strings. We can
safely use strins as the fonts don't have whitespaces in names.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
I really hate setting VERBOSE=3 and then run the script instead of
having a proper -v flag.

[how]
Process the options.

Also centralizes the detection if help is requested, and if so supress
contacting the Github servers with curl. That would not be used anyhow.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
If there is an unrecoverrable problem the temp directory will not be
removed.

[how]
Use a trap to remove it in any case.

Because we do not have a global variable with the directory name we
evaluate it right away when setting the trap.

Note that re-setting the trap would remove the old trap! We need to
make certain we have not multiple temp directories with one script
execution.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
We need the case-insensitive regex for this, and all other places that
use shell regexes are fine with the change, so we do it script globally.

Most of the changeset is a naming change from $1 to a concrete variable.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
We do not support two-word long options due to lazyness reasons.

ok:
  -r v3.4.0
  --release=v3.4.0

not supported:
  --release v3.4.0

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Older releases have no xz archives.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
Some 'normal' information is displayed at verbosity level 1.
The level 0 is in fact 'quiet'.

I changed the default to 0 with adding the `-v` option.

But immediately reconsidered and added the `-q` option to switch to
silent mode, so the default can revert back to 1. But somehow forget to
change the actual default.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added 6 commits October 8, 2026 20:40
[why]
We want to have the same options available before and after the command.

[how]
Put argument processing into function.
Call function twice, one initially and then once after the positional
argument 'cmd' has been determined.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Also move version information only into actual command run.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
In case we want to add more options with arguments later on.

Also reorder functions so that they are in the general 'section' given
by the comments.
And also - unrelated - put startup information on error stream.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii
Finii force-pushed the feat/install-multiple-font-names branch from d3b13d1 to 010d7ba Compare October 8, 2026 18:44
@Finii

Finii commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

rebase on master, force push

@Finii
Finii merged commit 61d1b97 into ryanoasis:master Oct 8, 2026
@Finii

Finii commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Thank you again for triggering this!

Works on Mac:

Screenshot 2026-10-08 at 23 56 28

@danifbento

Copy link
Copy Markdown
Contributor Author

Cool! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants