Skip to content

Commit

Permalink
Move all || operators into if blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Feb 20, 2025
1 parent 2c9142b commit 7683ee2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
5 changes: 4 additions & 1 deletion ci/scripts/utils/launch_java_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ echo "JAVA VERSION: "
${JAVA} -version

GH=$(command -v gh || echo "${HOME}/bin/gh")
[[ -f "${GH}" ]] || ( echo "ERROR: GitHub CLI (gh) not found. (exiting with error)"; exit 1 )
if [[! -f "${GH}" ]]; then
echo "ERROR: GitHub CLI (gh) not found. (exiting with error)"
exit 1
fi
${GH} --version
export GH

Expand Down
4 changes: 3 additions & 1 deletion ctests/scripts/stage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ HOMEgfs="@PROJECT_SOURCE_DIR@"
set +x
source "${HOMEgfs}/workflow/gw_setup.sh"
rc=$?
[[ "${rc}" -ne 0 ]] && exit "${status}"
if [[ "${rc}" -ne 0 ]]; then
exit "${status}"
fi
set -x
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
export PYTHONPATH
Expand Down
4 changes: 3 additions & 1 deletion ctests/scripts/validate.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ HOMEgfs="@PROJECT_SOURCE_DIR@"
set +x
source "${HOMEgfs}/workflow/gw_setup.sh"
rc=$?
[[ "${rc}" -ne 0 ]] && exit "${status}"
if [[ "${rc}" -ne 0 ]]; then
exit "${status}"
fi
set -x
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
export PYTHONPATH
Expand Down
8 changes: 6 additions & 2 deletions ush/atmos_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ fcnt=1 # 1 is 1st quarter, 2 is 2nd quarter and 3 is 3rd quarter of the day
dcnt=1 # lead day
subdata=${1}

[[ -d "${subdata}" ]] || mkdir -p "${subdata}"
if [[! -d "${subdata}" ]]; then
mkdir -p "${subdata}"
fi

for outtype in "f2d" "f3d"; do

Expand All @@ -29,7 +31,9 @@ for outtype in "f2d" "f3d"; do
fi

outdirpre="${subdata}/${outtype}"
[[ -d "${outdirpre}" ]] || mkdir -p "${outdirpre}"
if [[! -d "${outdirpre}" ]]; then
mkdir -p "${outdirpre}"
fi

if [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
if [[ "${outtype}" == "f2d" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion ush/gaussian_sfcanl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export REDERR=${REDERR:-'2>'}
${INISCRIPT:-}
pwd=$(pwd)
cd "${DATA}" || exit 99
[[ -d "${COMOUT_ATMOS_ANALYSIS}" ]] || mkdir -p "${COMOUT_ATMOS_ANALYSIS}"
if [[! -d "${COMOUT_ATMOS_ANALYSIS}" ]]; then
mkdir -p "${COMOUT_ATMOS_ANALYSIS}"
fi

################################################################################
# Make surface analysis
Expand Down
4 changes: 3 additions & 1 deletion ush/ocnice_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ datacompress=${4}
fhout_ocnice=${5}
comout_rfcst_prod_ocnice=${6}

[[ -d "${subdata}" ]] || mkdir -p "${subdata}"
if [[! -d "${subdata}" ]]; then
mkdir -p "${subdata}"
fi

for (( nh = FHMIN_GFS + fhout_ocnice; nh <= FHMAX_GFS; nh = nh + fhout_ocnice )); do
fnh=$(printf "%3.3d" "${nh}")
Expand Down
4 changes: 3 additions & 1 deletion ush/wave_extractvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ com_dir=${!com_varname}

subdata=${1}

[[ -d "${subdata}" ]] || mkdir -p "${subdata}"
if [[! -d "${subdata}" ]]; then
mkdir -p "${subdata}"
fi

for (( nh = FHOUT_WAV_EXTRACT; nh <= FHMAX_WAV; nh = nh + FHOUT_WAV_EXTRACT )); do
fnh=$(printf "%3.3d" "${nh}")
Expand Down

0 comments on commit 7683ee2

Please sign in to comment.