Skip to content

Commit

Permalink
Add scripts for getting current version, OS name
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnorri committed Aug 12, 2019
1 parent 4ffaa99 commit 653664d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tools/git_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

IFS='\n'
TAGS=`git tag -l --points-at HEAD`
HASH=`git rev-parse --short --verify HEAD`
VERSION="DEV"
if [ -n "${TAGS}" ]
then
for name in ${TAGS}
do
if [[ "${name}" == v* ]]
then
VERSION="${name:1}"
break
fi
done
fi
echo ${VERSION} ${HASH}
12 changes: 12 additions & 0 deletions tools/os_name.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

_=`which sw_vers`
if [ 0 -eq $? ] # macOS
then
set -e
name=`sw_vers -productName`
else
set -e
name=`uname -s`
fi
echo "${name}" | awk '{ gsub(" ", "") ; print tolower($0) }'

0 comments on commit 653664d

Please sign in to comment.