Skip to content

Commit

Permalink
package.json is not used any more for version detection. fix #114
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Jun 14, 2017
1 parent 5afe6cf commit 322029b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: deploy deploy-github deploy-npm test env

VERSIONS_COUNT=`grep 'version' package.json bower.json index.js | grep -o -E '[0-9]\.[0-9]{1,2}\.[0-9]{1,2}' | sort | uniq | wc -l`

env:
@rm -rf env && \
Expand All @@ -22,4 +23,10 @@ deploy-github:
deploy-npm:
npm publish

deploy: test deploy-npm deploy-github
check-versions:
@if [ "$(VERSIONS_COUNT)" != "1" ]; then\
echo "\n\tVersions in *.js and *.json are different!\n";\
exit 1; fi


deploy: test check-versions deploy-npm deploy-github
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sitemap.js",
"main": "index.js",
"version": "1.12.0",
"version": "1.12.1",
"dependencies": {
"url-join": "^1.1.0",
"underscore": "1.7.0"
Expand Down
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ module.exports.errors = require('./lib/errors');
/**
* Framework version.
*/
var fs = require('fs');

if (!module.exports.version) {
module.exports.version = JSON.parse(
fs.readFileSync(__dirname + "/package.json", 'utf8')).version;
module.exports.version = "1.12.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sitemap",
"version": "1.12.0",
"version": "1.12.1",
"description": "Sitemap-generating framework",
"keywords": [
"sitemap",
Expand Down

0 comments on commit 322029b

Please sign in to comment.