diff --git a/Makefile.am b/Makefile.am index b6897e1..c0c6893 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ bin_SCRIPTS = fontship python_PYTHON = fontship.py dist_doc_DATA = README.md dist_license_DATA = LICENSE -dist_data_DATA = src/rules.mk src/functions.mk +dist_data_DATA = src/rules.mk src/functions.mk src/pre-commit.py CLEANFILES = $(bin_SCRIPTS) diff --git a/configure.ac b/configure.ac index a151071..72a9cda 100644 --- a/configure.ac +++ b/configure.ac @@ -20,5 +20,6 @@ AM_PATH_PYTHON([3.6]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([fontship], [chmod +x fontship]) +AC_CONFIG_FILES([src/pre-commit.py], [chmod +x src/pre-commit.py]) AC_OUTPUT diff --git a/fontship.in b/fontship.in index a90cb78..974d8c7 100644 --- a/fontship.in +++ b/fontship.in @@ -1,4 +1,4 @@ -#!/usr/bin/env @PYTHON@ +#!@PYTHON@ __version__ = "@VERSION@" @@ -41,7 +41,10 @@ fontship.add_command(make) @click.pass_context def setup(ctx): """Setup Fontship for use on a new Font project.""" - click.echo("Anybody want a penut") + repo = fontship.Repo() + args = ['ln', '-sf', SRCDIR + 'pre-commit.py', repo.git.path + 'hooks/pre-commit'] + process = subprocess.run(args, check=True) + process fontship.add_command(setup) diff --git a/src/pre-commit.py.in b/src/pre-commit.py.in new file mode 100755 index 0000000..bf3a5a9 --- /dev/null +++ b/src/pre-commit.py.in @@ -0,0 +1 @@ +#!@PYTHON@