Compare commits

..

6 Commits

Author SHA1 Message Date
b980432bb4 Fix bug in comment 2022-02-08 12:12:20 -05:00
66480b2bf6 Test hook again 2022-02-08 12:09:44 -05:00
8be989160e Include hooks in repo 2022-02-08 12:09:21 -05:00
262e874897 Testing pre-hook 2022-02-08 12:07:59 -05:00
5d46c95808 Track Revision 2022-02-08 11:51:24 -05:00
da9d81f2a0 Add better variables and readability 2022-02-08 11:50:35 -05:00
5 changed files with 37 additions and 18 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,2 @@
_build
*.*#
brightspace/

View File

@@ -1,2 +1 @@
_build
brightspace/

View File

@@ -1,35 +1,44 @@
# Written by joe
# Revision 66480b2b
# Variables
REVISION := "$(shell git describe --abbrev=8 --dirty --always --tags)"
# Paths
ROOT := "$(PWD)"
BUILDDIR := $(ROOT)/_build
SUBMITDIR := $(BUILDDIR)/Brightspace
all: pdf submit
# Move all files to the build dir
# Move everything required to builddir
copy:
mkdir -p _build
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} _build \;
mkdir -p $(BUILDDIR)
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} $(BUILDDIR) \;
# Build source in buildir into pdf
pdf: copy
cd _build && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \;
cd $(BUILDDIR) && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \;
# Package everything into a neat little zip + pdf
submit: pdf
rm -rvf brightspace
mkdir -p brightspace
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} brightspace \;
cd brightspace && zip $(REVISION)_source.zip *
cp _build/*.pdf brightspace
rm -rvf $(SUBMITDIR)
mkdir -p $(SUBMITDIR)
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" -o -name "Makefile" ')' -exec cp {} $(SUBMITDIR) \;
cd $(SUBMITDIR) && zip $(REVISION)_source.zip *
cp $(BUILDDIR)/*.pdf $(SUBMITDIR)
echo "Auto generated using software written by Joe." > brightspace/README.md
echo "This build and all artifacts were built locally on this date: " >> brightspace/README.md
date >> brightspace/README.md
echo "Auto generated using software written by Joe." > $(SUBMITDIR)/README.md
echo "This build and all artifacts were built locally on this date: " >> $(SUBMITDIR)/README.md
date >> $(SUBMITDIR)/README.md
# cleanup
cd brightspace && find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec rm {} \;
cd $(SUBMITDIR) && find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" -o -name "Makefile" ')' -exec rm {} \;
# Clean all
clean:
git clean -fdX
rm -rvf brightspace
rm -rvf $(SUBMITDIR)

6
hooks/pre-commit Executable file
View File

@@ -0,0 +1,6 @@
# Written by Joe
# Version
REVISION="$(git describe --abbrev=8 --always --tags)"
sed -i "2s/.*/Revision ${REVISION}/" 'Paper With Citations/Makefile'

6
test.txt Normal file
View File

@@ -0,0 +1,6 @@
This
$(describe)
is
a
sed
test