Skip to content

Commit 0456a38

Browse files
committed
Remove a symbolic link to SDK when cleaning
- Remove the symbolic link created by `./run setup` when `./run clean` command is executed. Signed-off-by: Gigon Bae <gbae@nvidia.com>
1 parent 04918a6 commit 0456a38

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

run

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,23 @@ clean() {
391391
run_command ${MONAI_PY_EXE} -m pip uninstall monai-deploy-app-sdk
392392
fi
393393

394+
local monai_package_path=$(${MONAI_PY_EXE} $TOP/monai/deploy/utils/importutil.py dist_module_path monai)
395+
local sdk_package_path=$(${MONAI_PY_EXE} $TOP/monai/deploy/utils/importutil.py dist_module_path monai-deploy-app-sdk)
396+
local is_sdk_editable="false"
397+
398+
if ${MONAI_PY_EXE} $TOP/monai/deploy/utils/importutil.py is_dist_editable monai-deploy-app-sdk; then
399+
is_sdk_editable="true"
400+
fi
401+
402+
c_echo b "monai_package_path: " Z "${monai_package_path}"
403+
c_echo b "sdk_package_path : " Z "${sdk_package_path}"
404+
c_echo b "is_sdk_editable : " Z "${is_sdk_editable}"
405+
406+
if [ "$is_sdk_editable" = "false" ] && [ -n "${monai_package_path}" ] && [ -L ${monai_package_path}/monai/deploy ]; then
407+
c_echo W "Deleting a symbolic link at " b "'${monai_package_path}/monai/deploy'... "
408+
run_command rm ${monai_package_path}/monai/deploy
409+
fi
410+
394411
# Remove temporary files (in the directory of this script)
395412
c_echo W "Removing temporary files in ${TOP}"
396413
run_command find ${TOP}/monai -type f -name "*.py[co]" -delete

0 commit comments

Comments
 (0)