Fix unbound variable errors

This commit is contained in:
2022-06-02 16:08:07 +02:00
parent a6eeccb417
commit 4f8c1b5388
15 changed files with 85 additions and 86 deletions

View File

@@ -35,10 +35,10 @@ step_20() {
error -e "No configuration file found"
return 1
fi
if [ ! -z $FR_BACKUP ] ; then
if [ -n "$FR_BACKUP" ] ; then
exe mkdir -p "$FR_BACKUP"
fi
if [ ! -z "$1" ] ; then
if [ -n "${1:-}" ] ; then
tempRoot="$1"
else
tempRoot="$FR_LOC"
@@ -61,7 +61,7 @@ step_20() {
step_22_info() {
shift
if [ -z $1 ] ; then
if [ -z "${1:-}" ] ; then
echo -n "Get latest version from github"
if ! contextHelp ; then
echo ": $(curl --silent "$latestUrl" | grep -Po '"tag_name": "\K.*?(?=")')"
@@ -76,7 +76,7 @@ step_22_alias() { echo "upgrade"; }
step_22() {
shift # don't need step number
local latestVersion=
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
latestVersion="$1"
else
latestVersion=$(curl --silent "$latestUrl" | grep -Po '"tag_name": "\K.*?(?=")')