Skip to content

Commit 8bf30fb

Browse files
committed
bugfix: overlay path missing from user catalog
1 parent a9cab8a commit 8bf30fb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

icrn_manager

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,16 @@ function kernels__use() # use a kernel which is already checked out
350350

351351
case $language in
352352
"R")
353+
if [ -z "$overlay_path" ] || [ "$overlay_path" = "null" ]; then
354+
echo "ERROR: Overlay path missing from user catalog for $language $targetname $version."
355+
echo "Run 'icrn_manager kernels get $language $targetname $version' to re-register the overlay."
356+
exit 1
357+
fi
358+
if [ ! -d "$overlay_path" ]; then
359+
echo "ERROR: Overlay path recorded in user catalog does not exist: $overlay_path"
360+
echo "Consider cleaning and re-checking out this kernel."
361+
exit 1
362+
fi
353363
target_kernel_link_path=${ICRN_USER_KERNEL_BASE}/${targetname}
354364
if [ -e "$target_kernel_link_path" ]; then
355365
echo "Found existing link; removing..."
@@ -669,7 +679,11 @@ function kernels__get_in_place() # prep for 'use' without relocating kernel
669679
echo "registering R library"
670680
register_r_library_in_user_catalog "$target_location" "$language" "$targetname" "$version"
671681
echo "registering user overlay"
672-
register_user_overlay_in_user_catalog "$language" "$targetname" "$version"
682+
if ! register_user_overlay_in_user_catalog "$language" "$targetname" "$version"; then
683+
echo "ERROR: Failed to register user overlay for $language $targetname $version"
684+
echo "Please ensure ${ICRN_USER_KERNEL_BASE} is writable and retry the checkout."
685+
exit 1
686+
fi
673687
;;
674688
"Python")
675689
register_python_library_in_user_catalog "$target_location" "$language" "$targetname" "$version"

0 commit comments

Comments
 (0)