Skip to content

Commit

Permalink
add version script
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 25, 2018
1 parent 33f3375 commit 05818bf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: publish test coveralls lint

VERSION=DEV
VERSION=0.1.0
DATE=`date -uR`

GIT=git
Expand Down
2 changes: 1 addition & 1 deletion dist/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2018 Jakub Jankiewicz <http://jcubic.pl/me>
* Released under the MIT license
*
* build: Sun, 25 Feb 2018 11:44:14 +0000
* build: Sun, 25 Feb 2018 15:13:13 +0000
*/
"use strict";
/* global define, module, setTimeout, jQuery */
Expand Down
2 changes: 1 addition & 1 deletion dist/lips.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Makefile: templates/Makefile
$(SED) -e "s/{{VER""SION}}/"$(VERSION)"/" templates/Makefile > Makefile

package.json: templates/package.json .$(VERSION)
$(TEST) "$(VERSION)" != DEV && $(SED) -e "s/{{VER}}/"$(VERSION)"/" templates/package.json > package.json || true
$(SED) -e "s/{{VER}}/"$(VERSION)"/" templates/package.json > package.json || true

README.md: templates/README.md
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" < templates/README.md > README.md || $(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" < templates/README.md > README.md
Expand Down
10 changes: 10 additions & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Display current version or update version if used with version as argument

VERSION=`grep VERSION= Makefile | sed -e 's/VERSION=\(.*\)/\1/'`
if [ -z "$1" ]; then
echo $VERSION
elif [ "$1" != "$VERSION" ]; then
sed -e "s/{{VERSION}}/"$1"/" templates/Makefile > Makefile
fi

0 comments on commit 05818bf

Please sign in to comment.