[WIP] Replace installation script with bash version that performs a more robust installation process #358
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The attached installation script is a clean-up version of what I've been using for the past few years when installing fonts from a number of sources, including this repository (
powerline/fonts
) as well as others (likeryanoasis/nerd-fonts
); I'm not sure if you'd want something this long to and bash-dependent to replace the simplesh
script, but I'll enumerate the additional features here and let the community and yourself decide its merit.INSTALL_FONT_ROOT_PATH
environment variable. An example of installation using a custom target path would beINSTALL_FONT_ROOT_PATH=/custom/font/path ./install.bash
.~/.fonts
directory for installation on *nix.install.sh Ubuntu
). This filter was was case-sensitive and only filtered based on the font file name. This new script allows for any number of filters (likeinstall.bash ubuntu firamono [etc]
) and is no longer case-sensitive. While this script also performs the filter search via the file name (for example passingfuramono
will continue to match the font fileFuraMono-Bold Powerline.otf
) it additionally performs the filter search via the directory the font is in (for example passingfiramono
will not match the file name but it will match the same file because of its path ofFiraMono/FuraMono-Bold Powerline.otf
)./usr/share/fonts
they can simply callINSTALL_FONT_ROOT_PATH=/usr/share/fonts ./install.bash
without having to run the whole script withsudo
and the script will automatically utilize sudo to copy the files.<root>/<type>/<family>/<file>.<ext>
. An example of a resolved target path is~/.fonts/opentype/FiraMono/FuraMono-Bold-Powerline.otf
. Below is a short description of the path placeholders used prior:root
: the requested or automatically determined installation root (such as~/.fonts
).type
: the font file type (extension) name (such asopentype
,truetype
, andpcf
).family
: the font family name as determined by the folder structure (such asUbuntu
, orFiraMono
, etc).file
: the font file name (such asFuraMono-Bold-Powerline
, etc).ext
: the font file extension (such asotf
, etc).There may be a few other changes, but the above list covers the major, important distinctions this script has from the existing one.
Note: this is still a work in progress (for example,
fc-cache
isn't yet called and it has not been compatibility-tested with Darwin); do not merge as-is (I will update to remedy these issues if interest exists for this script's inclusion in the project).