<commit_before>SHA := $(shell git rev-parse HEAD)
THIS_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

all:
	@npm install

tmp = 'tmp_build'
clean:
	@rm -rf ${tmp}

get-swig: clean
	@git checkout master
	@make && make build
	@mkdir -p ${tmp}
	@git checkout ${THIS_BRANCH}
	@rm -rf tests
	@rm views/js/swig*
	@(cd views/js && ln -s ../../dist/swig.js ./swig.js)
	@(cd views/js && ln -s ../../dist/swig.min.js ./swig.min.js)
	@(cd views/js && ln -s ../../dist/swig.pack.js ./swig.pack.js)
	@(cd views/js && ln -s ../../dist/swig.pack.min.js ./swig.pack.min.js)
	@git commit -n -am "Automated updating swig.js" &>/dev/null


remote=dev
branch=gh-pages
build: all clean
	@make get-swig -i
	@mkdir -p views/css
	@node_modules/.bin/lessc --yui-compress --include-path=views/less views/less/swig.less views/css/swig.css
	@node_modules/.bin/still views -o ${tmp} -i "layout" -i "json" -i "less"
	@mkdir -p ${tmp}/js
	@cp dist/swig.* ${tmp}/js/
	@cp node_modules/zepto/zepto.min.js ${tmp}/js/lib
	@git checkout ${branch}
	@cp -r ${tmp}/* ./
	@rm -rf ${tmp}
	@git add .
	@git commit -n -am "Automated build from ${SHA}"
	@git push ${remote} ${branch}
	@git checkout ${THIS_BRANCH}

port = 3000
run:
	@node_modules/.bin/still-server views/ -p ${port} -o

lint:
	@echo '0 errors'

test:
	@echo ''<commit_msg>switch to origin<commit_after>SHA := $(shell git rev-parse HEAD)
THIS_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

all:
	@npm install

tmp = 'tmp_build'
clean:
	@rm -rf ${tmp}

get-swig: clean
	@git checkout master
	@make && make build
	@mkdir -p ${tmp}
	@git checkout ${THIS_BRANCH}
	@rm -rf tests
	@rm views/js/swig*
	@(cd views/js && ln -s ../../dist/swig.js ./swig.js)
	@(cd views/js && ln -s ../../dist/swig.min.js ./swig.min.js)
	@(cd views/js && ln -s ../../dist/swig.pack.js ./swig.pack.js)
	@(cd views/js && ln -s ../../dist/swig.pack.min.js ./swig.pack.min.js)
	@git commit -n -am "Automated updating swig.js" &>/dev/null


remote=origin
branch=gh-pages
build: all clean
	@make get-swig -i
	@mkdir -p views/css
	@node_modules/.bin/lessc --yui-compress --include-path=views/less views/less/swig.less views/css/swig.css
	@node_modules/.bin/still views -o ${tmp} -i "layout" -i "json" -i "less"
	@mkdir -p ${tmp}/js
	@cp dist/swig.* ${tmp}/js/
	@cp node_modules/zepto/zepto.min.js ${tmp}/js/lib
	@git checkout ${branch}
	@cp -r ${tmp}/* ./
	@rm -rf ${tmp}
	@git add .
	@git commit -n -am "Automated build from ${SHA}"
	@git push ${remote} ${branch}
	@git checkout ${THIS_BRANCH}

port = 3000
run:
	@node_modules/.bin/still-server views/ -p ${port} -o

lint:
	@echo '0 errors'

test:
	@echo ''
{'fraction_non_alphanumeric': 0.20721412125863392, 'fraction_numerical': 0.003837298541826554, 'mean_word_length': 2.980152671755725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4830980', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1090, 'n_words': 294}