Skip to content

Commit 85f7f32

Browse files
authored
Add --nofontconfig option
Add --nofontconfig option to install.sh to skip creation of ~/.fonts and requirement for fontconfig to be installed (useful option for those only accessing a headless server via SSH where the font needs to be set on their local terminal application)
2 parents 6c9f1f3 + c78715d commit 85f7f32

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
> Any trouble, please visit the [troubleshooting page](https://github.com/diogocavilha/fancy-git/blob/master/TROUBLESHOOTING.md)
44
5+
## v7.1.9
6+
- Add --nofontconfig option to install.sh to skip creation of ~/.fonts and requirement for fontconfig to be installed (useful option for those only accessing a headless server via SSH where the font needs to be set on their local terminal application)
7+
58
## v7.1.8
69
- Update installed to check fontconfig is installed prior to running script
710

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ curl -sS https://raw.githubusercontent.com/diogocavilha/fancy-git/master/uninsta
3737
- **JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf**.
3838
It's necessary for rendering icons/symbols properly.
3939
If you can't find the font, it's still possible to install it manually by running `fancygit --fonts-install` or even installing the ttf file which is placed at `~/.fancy-git/fonts/`.
40+
NB for Windows Terminal only the Sauce Code option above will display git icons correctly.
4041
2. Restart your terminal.
4142

4243
Run `fancygit -h` to check FancyGit help.

install.sh

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ if [ "" = "$FANCYGIT_GIT_PATH" ]; then
2020
exit 0
2121
fi
2222

23-
if [ "dpkg-query: no packages found matching fontconfig" = "$FANCYGIT_FONTCONFIG_PATH" ]; then
24-
errcho ""
25-
errcho " ⚠ Please install fontconfig before running this command."
26-
errcho ""
27-
exit 0
23+
if [ "--nofontconfig" = "$1" ]; then
24+
echo "--nofontconfig selected: skipping fontconfig check"
25+
else
26+
if [ "dpkg-query: no packages found matching fontconfig" = "$FANCYGIT_FONTCONFIG_PATH" ]; then
27+
errcho ""
28+
errcho " ⚠ Please either install fontconfig before running this command"
29+
errcho " or use the --nofontconfig option to install fancygit"
30+
errcho " without fontconfig present - e.g., if only using SSH"
31+
errcho ""
32+
exit 0
33+
fi
2834
fi
2935

3036
git clone https://github.com/diogocavilha/fancy-git.git ~/.fancy-git
@@ -51,11 +57,15 @@ if [ "Darwin" = "$FANCYGIT_RUNNING_OS" ]; then
5157
cat ~/.fancy-git/app_config_sample > ~/.fancy-git/app_config
5258
fi
5359

54-
mkdir -p ~/.fonts
55-
cp -i ~/.fancy-git/fonts/SourceCodePro+Powerline+Awesome+Regular.ttf ~/.fonts
56-
cp -i ~/.fancy-git/fonts/Sauce-Code-Pro-Nerd-Font-Complete-Windows-Compatible.ttf ~/.fonts
57-
cp -i ~/.fancy-git/fonts/DejaVu-Sans-Mono-Nerd-Font-Complete.ttf ~/.fonts
58-
cp -i ~/.fancy-git/fonts/DejaVu-Sans-Mono-Nerd-Font-Complete-Mono.ttf ~/.fonts
59-
cp -i ~/.fancy-git/fonts/JetBrains-Mono-Regular-Nerd-Font-Complete-Mono.ttf ~/.fonts
60-
cp -i ~/.fancy-git/fonts/JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf ~/.fonts
61-
fc-cache -fv
60+
if [ "--nofontconfig" = "$1" ]; then
61+
echo "--nofontconfig selected: skipping font installation"
62+
else
63+
mkdir -p ~/.fonts
64+
cp -i ~/.fancy-git/fonts/SourceCodePro+Powerline+Awesome+Regular.ttf ~/.fonts
65+
cp -i ~/.fancy-git/fonts/Sauce-Code-Pro-Nerd-Font-Complete-Windows-Compatible.ttf ~/.fonts
66+
cp -i ~/.fancy-git/fonts/DejaVu-Sans-Mono-Nerd-Font-Complete.ttf ~/.fonts
67+
cp -i ~/.fancy-git/fonts/DejaVu-Sans-Mono-Nerd-Font-Complete-Mono.ttf ~/.fonts
68+
cp -i ~/.fancy-git/fonts/JetBrains-Mono-Regular-Nerd-Font-Complete-Mono.ttf ~/.fonts
69+
cp -i ~/.fancy-git/fonts/JetBrains-Mono-Medium-Nerd-Font-Complete-Mono.ttf ~/.fonts
70+
fc-cache -fv
71+
fi

0 commit comments

Comments
 (0)