Added test by a shell script static analysis tool(ShellCheck)

This commit is contained in:
Takeshi Nakatani
2022-01-15 17:08:46 +00:00
committed by Andrew Gaul
parent 93d1c30d4d
commit 46014397d8
12 changed files with 876 additions and 738 deletions

View File

@ -1,5 +1,5 @@
#! /bin/sh
#!/bin/sh
#
# This file is part of S3FS.
#
# Copyright 2009, 2010 Free Software Foundation, Inc.
@ -22,14 +22,12 @@
echo "--- Make commit hash file -------"
SHORTHASH="unknown"
type git > /dev/null 2>&1
if [ $? -eq 0 -a -d .git ]; then
RESULT=`git rev-parse --short HEAD`
if [ $? -eq 0 ]; then
SHORTHASH=${RESULT}
if command -v git > /dev/null 2>&1 && test -d .git; then
if RESULT=$(git rev-parse --short HEAD); then
SHORTHASH="${RESULT}"
fi
fi
echo ${SHORTHASH} > default_commit_hash
echo "${SHORTHASH}" > default_commit_hash
echo "--- Finished commit hash file ---"