Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 62 lines (48 sloc) 1.541 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
.SILENT: test test-functional test-issues


PATH := ./node_modules/.bin:${PATH}

PROJECT = $(notdir ${PWD})
TMP_DIR = /tmp/${PROJECT}-$(shell date +%s)

REMOTE_NAME ?= origin
REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)


test: test-functional test-issues

test-functional:
echo
echo "## FUNCTIONAL ##################################################################"
echo "################################################################################"
echo
node ./test/functional/run.js
echo

test-issues:
echo
echo "## ISSUES ######################################################################"
echo "################################################################################"
echo
node ./test/issues/run.js
echo


build: browserify uglify

browserify:
if test ! `which browserify` ; then npm install browserify ; fi
cp -r support/browserify/ ${TMP_DIR}
browserify index.js -o ${TMP_DIR}/50_js-yaml.js
cat ${TMP_DIR}/* > js-yaml.js
rm -rf ${TMP_DIR}
cp js-yaml.js demo/js/

uglify:
if test ! `which uglifyjs` ; then npm install uglify-js ; fi
uglifyjs js-yaml.js > js-yaml.min.js


gh-pages:
@if test -z ${REMOTE_REPO} ; then \
echo 'Remote repo URL not found' >&2 ; \
exit 128 ; \
fi
mkdir ${TMP_DIR}
cp -r demo/* ${TMP_DIR}
touch ${TMP_DIR}/.nojekyll
cd ${TMP_DIR} && \
git init && \
git add . && \
git commit -q -m 'Recreated docs'
cd ${TMP_DIR} && \
git remote add remote ${REMOTE_REPO} && \
git push --force remote +master:gh-pages
rm -rf ${TMP_DIR}
Something went wrong with that request. Please try again.