Fix git shortlog bug

This commit is contained in:
wpetit 2015-07-13 15:19:27 +02:00
parent 08fda00993
commit a33679f95f
1 changed files with 3 additions and 6 deletions

View File

@ -12,11 +12,9 @@ function show_usage {
function main {
cd $SRC_DIR
cd "$SRC_DIR"
git status 2>&1 1>/dev/null
if [ $? != 0 ]; then
if [ ! -d '.git' ]; then
fatal "The directory $SRC_DIR seems not to be a valid Git repository."
fi
@ -30,7 +28,7 @@ function main {
repo_name=$(basename `git rev-parse --show-toplevel`)
current_commit=$(git log -n 1 --pretty=format:"%h")
logs=$(git log --pretty=format:"%an - %h : %s" | sed 's/"/\\"/g')
git_maintainer=$(git shortlog -s -n -e 2>&1 | sed 's/^\s*[0-9]*\s*//g' | head -n 1)
git_maintainer=$(git shortlog -s -n -e 2>&1 < /dev/tty | sed 's/^\s*[0-9]*\s*//g' | head -n 1)
# Get current version from manifest
current_name=$(echo "$MANIFEST" | jq -r ".name" | sed 's/null//')
@ -62,7 +60,6 @@ function main {
}
# Load util lib
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$DIR/lib/util.sh"