summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-12-16 07:56:26 +0000
committerLeah Rowe <leah@libreboot.org>2023-12-16 07:56:26 +0000
commit1eb4df6748f94a08d44c623a56417199b99b371d (patch)
treee45f8b519cfe1e22dda8ef18763f8ae3546c477f /include
parent54ca5f24d20531ac728a9475a94912f0a08f29f7 (diff)
fix several shellcheck warnings
lbmk didn't quote certain arguments in commands, or used ! -z instead of -n, things like that. simple fixes. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/err.sh12
-rwxr-xr-xinclude/git.sh2
2 files changed, 7 insertions, 7 deletions
diff --git a/include/err.sh b/include/err.sh
index 595d6c77..3699d6ce 100755
--- a/include/err.sh
+++ b/include/err.sh
@@ -36,23 +36,23 @@ git_err()
check_project()
{
- read projectname < projectname || :
+ read -r projectname < projectname || :
- [ ! -f version ] || read version < version || :
+ [ ! -f version ] || read -r version < version || :
version_="${version}"
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
version="git-$(git rev-parse HEAD 2>&1)" || version="${version_}"
- [ ! -f versiondate ] || read versiondate < versiondate || :
+ [ ! -f versiondate ] || read -r versiondate < versiondate || :
versiondate_="${versiondate}"
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
--pretty='%ct' HEAD)" || versiondate="${versiondate_}"
- [ ! -z ${versiondate} ] || fail "Unknown version date" || \
+ [ -n "${versiondate}" ] || fail "Unknown version date" || \
err "Unknown version date"
- [ ! -z ${version} ] || fail "Unknown version" || \
+ [ -n "${version}" ] || fail "Unknown version" || \
err "Unknown version"
- [ ! -z ${projectname} ] || fail "Unknown project" || \
+ [ -n "${projectname}" ] || fail "Unknown project" || \
err "Unknown project"
xx_ printf "%s\n" "${version}" > version || \
diff --git a/include/git.sh b/include/git.sh
index 811b298a..9a73bd92 100755
--- a/include/git.sh
+++ b/include/git.sh
@@ -123,7 +123,7 @@ clone_project()
[ "${patchfail}" = "y" ] && err "PATCH FAIL"
x_ rm -Rf "${loc}"
- [ "${loc}" = "${loc%/*}" ] || x_ mkdir -p ${loc%/*}
+ [ "${loc}" = "${loc%/*}" ] || x_ mkdir -p "${loc%/*}"
mv "${tmp_git_dir}" "${loc}" || \
err "clone_project: !mv ${tmp_git_dir} ${loc}"
}