Skip to content

Commit d50eb5e

Browse files
authored
[RAPTOR-12446] Fix invalid test -nz (#1413)
The test builtin can't take multiple options in a single call, so this yields a syntax error. Additionally, `-n` (is set) and `-z` (is not set) presents a fun logic issue. :) The intent appears to be to check if the related variable is set before proceeding, so this removes the `z` from `-nz` to accomplish that.
1 parent 95c1619 commit d50eb5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/image-build-utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function build_dropin_env_dockerfile() {
4141
pwd
4242
pushd "$DROPIN_ENV_DIRNAME" || exit 1
4343
cp "$DRUM_WHEEL_REAL_PATH" .
44-
if [[ -nz "$MOD_WHEEL_FILENAME" ]]; then
44+
if [[ -n "$MOD_WHEEL_FILENAME" ]]; then
4545
cp "$MOD_WHEEL_PATH" .
4646
fi
4747

@@ -65,7 +65,7 @@ function build_dropin_env_dockerfile() {
6565
$sed -i "s/^datarobot-drum.*/${DRUM_WHEEL_FILENAME}${WITH_R}/" requirements.txt
6666

6767
# when given a moderations wheel file, inject into Dockerfile and requirements.txt
68-
if [[ -nz "$MOD_WHEEL_FILENAME" ]]; then
68+
if [[ -n "$MOD_WHEEL_FILENAME" ]]; then
6969
if ! grep -q "COPY \+${MOD_WHEEL_FILENAME}" Dockerfile; then
7070
$sed -i "/COPY \+requirements.txt \+requirements.txt/a COPY ${MOD_WHEEL_FILENAME} ${MOD_WHEEL_FILENAME}" Dockerfile
7171
fi

0 commit comments

Comments
 (0)