| @@ -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 | |||||
| @@ -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 .. | |||||
| @@ -7,7 +7,7 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; | |||||
| (function (exports) { | (function (exports) { | ||||
| exports.name = "mustache.js"; | exports.name = "mustache.js"; | ||||
| exports.version = "0.5.13"; | |||||
| exports.version = "%version%"; | |||||
| exports.tags = ["{{", "}}"]; | exports.tags = ["{{", "}}"]; | ||||
| exports.parse = parse; | exports.parse = parse; | ||||
| exports.compile = compile; | exports.compile = compile; | ||||
| @@ -1,6 +1,6 @@ | |||||
| { | { | ||||
| "name": "mustache", | "name": "mustache", | ||||
| "version": "0.5.0-dev", | |||||
| "version": "%version%", | |||||
| "description": "Logic-less {{mustache}} templates with JavaScript", | "description": "Logic-less {{mustache}} templates with JavaScript", | ||||
| "author": "mustache.js Authors <http://github.com/janl/mustache.js>", | "author": "mustache.js Authors <http://github.com/janl/mustache.js>", | ||||
| "keywords": ["mustache", "template", "templates", "ejs"], | "keywords": ["mustache", "template", "templates", "ejs"], | ||||