diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..893ee5a --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +# Make mustaches + +# make a release +release: args tag build-wrappers + @echo Done! + +args: +ifeq ($(version),) + @echo "Usage make release version=x.y.z" +else + @echo "Releasing: ${version}" +endif + +tag: + # splice in version + sed -i.bak -e "s|%version%|${version}|" mustache.js package.json + git commit -m 'Released ${version}' mustache.js + # tag the version + git tag ${version} + # revert the version + sed -i.bak -e 's|exports.version = "${version}"|exports.version = "%version%"|' mustache.js + sed -i.bak -e 's|"version": "${version}"|"version": "%version%"|' package.json + +build-wrappers: + # from that tag: + # build all wrappers / minify + git checkout $(version) + build/wrappers.sh $(version) + + git checkout gh-pages + mkdir ${version} + cp -r wrappers/mustache-* $(version)/ + cp mustache.js $(version)/ + cp package.json $(version)/ + # update gh-pages with release links & travis + # update npm + # update cdnjs + +# make test +test: + rspec spec/mustache_spec.rb + +PHONY: test release args tag build-wrappers diff --git a/build/wrappers.sh b/build/wrappers.sh new file mode 100755 index 0000000..0849113 --- /dev/null +++ b/build/wrappers.sh @@ -0,0 +1,17 @@ +#!/bin/sh -ex +if [ -z "$1" ]; then + echo "Usage: ./build-wrapper.sh x.y.z" + exit 1 +fi +version=$1 +cd wrappers + for wrapper in *; do + target_dir="mustache-${wrapper}-${version}" + mkdir -p $target_dir + target=$target_dir/${wrapper}.mustache.js + touch $target + cat ${wrapper}/mustache.js.pre >> ${target} + cat ../mustache.js >> ${target} + cat ${wrapper}/mustache.js.post >> ${target} + done +cd .. \ No newline at end of file diff --git a/mustache.js b/mustache.js index 09d3f59..53628ec 100644 --- a/mustache.js +++ b/mustache.js @@ -7,7 +7,7 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; (function (exports) { exports.name = "mustache.js"; - exports.version = "0.5.13"; + exports.version = "%version%"; exports.tags = ["{{", "}}"]; exports.parse = parse; exports.compile = compile; diff --git a/package.json b/package.json index 1845b86..a8aff1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mustache", - "version": "0.5.0-dev", + "version": "%version%", "description": "Logic-less {{mustache}} templates with JavaScript", "author": "mustache.js Authors ", "keywords": ["mustache", "template", "templates", "ejs"],