28 lines · 951 B · Shell
RawDownload
#!/bin/bashgit rev-list HEAD | sort > config.git-hashSRC_PATH=$1LOCALVER=`wc -l config.git-hash | awk '{print $1}'`if [ $LOCALVER \> 1 ] ; then    VER="$(git rev-list HEAD -n 1 | cut -c 1-7)"    if git status | grep -q "modified:" ; then        VER="${VER}+M"    fi    GIT_VERSION=$VERelse    GIT_VERSION=    VER="x"fiGIT_VERSION='"'$GIT_VERSION'"'rm -f config.git-hash mkdir -p codec/common/inccat $SRC_PATH/codec/common/inc/version_gen.h.template | sed "s/\$FULL_VERSION/$GIT_VERSION/g" > codec/common/inc/version_gen.h.newif cmp codec/common/inc/version_gen.h.new codec/common/inc/version_gen.h > /dev/null 2>&1; then    # Identical to old version, don't touch it (to avoid unnecessary rebuilds)    rm codec/common/inc/version_gen.h.new    echo "Keeping existing codec/common/inc/version_gen.h"    exit 0fimv codec/common/inc/version_gen.h.new codec/common/inc/version_gen.h echo "Generated codec/common/inc/version_gen.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t