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

Merge Linux and Mac Install Script + Fixes + Messages #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions util/install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# remove all fonts from ~/.local/share/fonts that start with "Monaspace"
rm -rf ~/.local/share/fonts/Monaspace*

# make the folder if it does not exist
mkdir -p ~/.local/share/fonts

# copy all fonts from ./otf to ~/.local/share/fonts
cp ./fonts/otf/* ~/.local/share/fonts
cp ../fonts/otf/* ~/.local/share/fonts
Copy link
Contributor

Choose a reason for hiding this comment

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

This depends on the current working directory when the script is called.

Maybe better use a path relative to the script location, then one can call the script from any directory?

Suggested change
cp ../fonts/otf/* ~/.local/share/fonts
# Get script directory
sd=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit; pwd)
# copy all fonts from ./otf to ~/.local/share/fonts
cp "${sd}/../fonts/otf/*" ~/.local/share/fonts

(Well, something to that effect)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this has still not been addressed.

You could call install.sh from any current working directory. But all the paths in the script are relative to the current working directory instead of relative to the script directory. That in effect means one needs to change into the concrete directory that the author of the script envisioned.

For example

cd ~/git/monaspace
util/install.sh

cd ~/git/monaspace/util
./install.sh

cd /tmp
~/git/monaspace/util/install.sh

They should imho all work.

For the script to assemble the source path of the font files it needs the absolute path of the script itself and from then on it could relative walk to the fonts directory. Thus the code above.


# copy variable fonts from ./variable to ~/.local/share/fonts
cp ./fonts/variable/* ~/.local/share/fonts
cp ../fonts/variable/* ~/.local/share/fonts

# Build font information caches
fc-cache -f