1 Star 0 Fork 7

OKOKOK88 / codefont

forked from 真如赝 / codefont 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install.sh.save 737 Bytes
一键复制 编辑 原始数据 按行查看 历史
free 提交于 2017-08-24 23:50 . 201708
#!/bin/bash
# 设置字体源目录
fontsrc=$( cd "$( dirname "$0" )" && pwd )
# if an argument is given it is used to select wich fonts to install
prefix="$1"
find_command="find \"$fontsrc lib\" \( -name '$prefix*.[o,t]tf' -or -name '$prefix*.pcf.gz' \) -type f -print0"
if [[ `uname` == 'Darwin' ]]; then
# MacOS
font_dir="$HOME/Library/Fonts"
else
# Linux
font_dir="$HOME/.local/share/fonts"
mkdir -p $font_dir
fi
# Copy all fonts to user fonts directory
echo "正在复制字体"
eval $find_command | xargs -0 -n1 -I % cp "%" "$font_dir/"
# Reset font cache on Linux
if command -v fc-cache @>/dev/null ; then
echo "更新系统字体缓存中"
fc-cache -f $font_dir
fi
echo "字体成功安装在 $font_dir"
Shell
1
https://gitee.com/chu888chu888/codefont.git
git@gitee.com:chu888chu888/codefont.git
chu888chu888
codefont
codefont
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891