From 110c0a66c3a2525216bfe1ec8b0fe61e1f2c4810 Mon Sep 17 00:00:00 2001 From: janEbert <janpublicebert@posteo.net> Date: Mon, 21 Oct 2024 17:01:36 +0200 Subject: [PATCH] Improve checking whether command exists --- pytorch-ddp-example/activate.sh | 2 +- pytorch-fsdp-example/activate.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch-ddp-example/activate.sh b/pytorch-ddp-example/activate.sh index b5d1de7..a0b9a2a 100644 --- a/pytorch-ddp-example/activate.sh +++ b/pytorch-ddp-example/activate.sh @@ -7,7 +7,7 @@ fi venv_dir="$curr_dir"/env-"$SYSTEMNAME" -[ -x "$(command -v deactivate)" ] && deactivate +[ "$(command -v deactivate)" ] && deactivate module --force purge if ! [ -f "$curr_dir"/modules.sh ]; then diff --git a/pytorch-fsdp-example/activate.sh b/pytorch-fsdp-example/activate.sh index b5d1de7..a0b9a2a 100644 --- a/pytorch-fsdp-example/activate.sh +++ b/pytorch-fsdp-example/activate.sh @@ -7,7 +7,7 @@ fi venv_dir="$curr_dir"/env-"$SYSTEMNAME" -[ -x "$(command -v deactivate)" ] && deactivate +[ "$(command -v deactivate)" ] && deactivate module --force purge if ! [ -f "$curr_dir"/modules.sh ]; then -- GitLab