Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
add version update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalmer committed Nov 11, 2015
1 parent f58852f commit 8e5e968
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dump/

settings.json
server/extracts.msgfmt
version.js
16 changes: 16 additions & 0 deletions bin/update-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
ver=$(git describe --abbrev=0)
complete=$(git describe)
branch=$(git rev-parse --abbrev-ref HEAD)
commit=$(git rev-parse HEAD)
timestamp=$(git log -1 --date=short --pretty=format:%cd)
cat > version.js << EOF
VERSION = {
"basic": "$ver",
"complete": "$complete",
"branch": "$branch",
"commit": "$commit",
"timestamp": "$timestamp"
};
EOF

2 changes: 2 additions & 0 deletions client/views/navigation/navigation.footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<footer class="footer">
<div class="container-fluid">
<div class="container-fluid links">
<span title="{{fullVersion}}" style="color: #aaa">Openki.net {{version}}</span>
|
<a href="/about" >{{mf 'main.about_link' 'About'}}</a>
<a href="http://openki.net">{{mf 'main.concept_link' 'Concept'}}</a>
<a href="/FAQ">{{mf 'main.faq_link' 'FAQ'}}</a>
Expand Down
4 changes: 4 additions & 0 deletions client/views/navigation/navigation.footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Template.footer.helpers({
version: function() { return VERSION && VERSION.basic+(VERSION.branch !== 'master' ? " "+VERSION.branch : ''); },
fullVersion: function() { return VERSION && VERSION.complete+' "'+VERSION.branch+'" '+VERSION.timestamp+" "+VERSION.commit; }
});
2 changes: 2 additions & 0 deletions lib/functions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mfPkg.init('en');

VERSION = false;

getSlug = function(Text) {
return Text
.toLowerCase()
Expand Down

0 comments on commit 8e5e968

Please sign in to comment.