From 03b78419f50c5921045c503eee1d697fca9f7827 Mon Sep 17 00:00:00 2001 From: indirectlylit Date: Thu, 18 Oct 2018 22:46:27 -0700 Subject: [PATCH] adding Git LFS --- .gitattributes | 5 +++++ .gitignore | 2 +- build_tools/i18n/fonts.py | 7 +++++++ docs/start/getting_started.rst | 5 +++-- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..af41813acd8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# use Git LFS to track large binary files +*.otf filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.ttc filter=lfs diff=lfs merge=lfs -text +*.woff filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index ef4f7da001e..036775cdd22 100644 --- a/.gitignore +++ b/.gitignore @@ -77,7 +77,7 @@ kolibri/**/build/* kolibri/**/static/* js-dist -# allow static assets to be checked in +# Allow static assets to be checked in. For large binary files, use Git LFS !kolibri/**/static/assets/ !kolibri/**/static/assets/* !kolibri/**/static/assets/**/* diff --git a/build_tools/i18n/fonts.py b/build_tools/i18n/fonts.py index 49a856ca958..bd62ceb482e 100644 --- a/build_tools/i18n/fonts.py +++ b/build_tools/i18n/fonts.py @@ -8,6 +8,7 @@ import io import json import logging +import mimetypes import os import re import sys @@ -88,6 +89,12 @@ def _woff_font_path(name, is_bold): def _load_font(path): + guess = mimetypes.guess_type(path) + if guess[0] not in ["font/ttc", "font/ttf", "font/otf", "font/woff"]: + logging.error("Not a font file: {}".format(path)) + logging.error("Guessed mimetype: '{}'".format(guess[0])) + logging.error("If this is a text file: do you have Git LFS installed?") + sys.exit(1) return subset.load_font(path, FONT_TOOLS_OPTIONS, dontLoadGlyphNames=True) diff --git a/docs/start/getting_started.rst b/docs/start/getting_started.rst index 07efcdcb66e..792fbf2dc92 100644 --- a/docs/start/getting_started.rst +++ b/docs/start/getting_started.rst @@ -18,7 +18,7 @@ Most of the steps below require entering commands into your Terminal (Linux, Mac Git & GitHub ~~~~~~~~~~~~ -#. Install and set-up `Git `__ on your computer. Try this `tutorial `__ if you need more practice with Git! +#. Install and set up `Git `__ on your computer. Try this `tutorial `__ if you need more practice with Git! #. `Sign up and configure your GitHub account `__ if you don't have one already. #. `Fork the main Kolibri repository `__. This will make it easier to `submit pull requests `__. Read more details `about forking `__ from GitHub. @@ -30,6 +30,7 @@ Install environment dependencies #. Install `pip `__ package installer. #. Install `Node.js `__ (version 6 is required). #. Install `Yarn `__ according the `instructions specific for your OS `__. +#. Install and set up the `Git LFS extension `__. Remember to initialize with ``git lfs install`` after installing. .. note:: Installing Node.js version 6.x: @@ -39,7 +40,7 @@ Install environment dependencies .. code-block:: bash - # Add apt sources from nodesource.com + # Add apt sources from nodesource.com curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - # Verify the latest version 6 of nodejs apt-cache showpkg nodejs-legacy