Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Versioning, prepration for the first release

  • Loading branch information...
commit 3858aa850c5d6b79fbba0dd5a4f1295523c745da 1 parent bbda223
@majek majek authored
Showing with 49 additions and 8 deletions.
  1. +19 −8 Makefile
  2. +30 −0 VERSION-GEN
View
27 Makefile
@@ -25,19 +25,30 @@ tests: tests/html/lib/sockjs.js tests/html/lib/tests.js
serve:
- @if [ -e .pidfile.pid ]; then \
- kill `cat .pidfile.pid`; \
+ @if [ -e .pidfile.pid ]; then \
+ kill `cat .pidfile.pid`; \
rm .pidfile.pid; \
fi
- @while [ 1 ]; do \
+ @while [ 1 ]; do \
echo " [*] Running http server"; \
- make test & \
- SRVPID=$$!; \
+ make test & \
+ SRVPID=$$!; \
echo $$SRVPID > .pidfile.pid; \
echo " [*] Server pid: $$SRVPID"; \
- inotifywait -r -q -e modify .; \
- kill `cat .pidfile.pid`; \
+ inotifywait -r -q -e modify .; \
+ kill `cat .pidfile.pid`; \
rm -f .pidfile.pid; \
- sleep 0.1; \
+ sleep 0.1; \
done
+
+VER:=$(shell ./VERSION-GEN)
+upload: build
+ [ -e ../sockjs-client-gh-pages ] || \
+ git clone `git remote -v|tr "[:space:]" "\t"|cut -f 2` \
+ --branch gh-pages ../sockjs-client-gh-pages
+ (cd ../sockjs-client-gh-pages; git pull;)
+ for f in sock*js; do \
+ cp $$f ../sockjs-client-gh-pages/`echo $$f|sed 's|\(sockjs\)\(.*[.]js\)|\1-$(VER)\2|g'`; \
+ done
+ (cd ../sockjs-client-gh-pages; node generate_index.js > index.html;)
View
30 VERSION-GEN
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+DEF_VER=unknown
+
+LF='
+'
+
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if test -f version
+then
+ VN=$(cat version) || VN="$DEF_VER"
+elif test -d .git -o -f .git &&
+ VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ v[0-9]*)
+ git update-index -q --refresh
+ test -z "$(git diff-index --name-only HEAD --)" ||
+ VN="$VN-dirty" ;;
+ esac
+then
+ VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+ VN="$DEF_VER"
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+
+echo "$VN"
Please sign in to comment.
Something went wrong with that request. Please try again.