diff --git a/get-updated-manifest-from-git.sh b/get-updated-manifest-from-git.sh index 310bed3..60832b1 100755 --- a/get-updated-manifest-from-git.sh +++ b/get-updated-manifest-from-git.sh @@ -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"