Skip to content

Commit f2bbce4

Browse files
authored
fix: don't exit if you want a user to source this script (#717)
Calling `exit` inside the `lfs_check` function (after we've confirmed that the script is sourced) will cause the script to close the terminal that opened it. Changing it to return 1 will propagate a return signal and allow the user to properly read the error.
1 parent bb04888 commit f2bbce4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hdk_setup.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ function check_git_lfs {
7373
echo "Please install git-lfs:" >&2
7474
echo " For RHEL/CentOS/Rocky: sudo yum install git-lfs" >&2
7575
echo " For Ubuntu/Debian: sudo apt-get install git-lfs" >&2
76-
exit 1
76+
return 1
7777
fi
78+
79+
return 0
7880
}
7981

8082
# Process command line args
@@ -205,7 +207,10 @@ cl_ip_path="hdk/common/ip"
205207
cl_ip_branch="Vivado_$VIVADO_TOOL_VERSION-$cl_ip_path"
206208

207209
if [ $skip_downloads -eq 0 ]; then
208-
check_git_lfs
210+
check_git_lfs
211+
if [ $? -ne 0 ]; then
212+
return 1
213+
fi
209214
git submodule update --init $cl_ip_path
210215
git -C $cl_ip_path checkout $cl_ip_branch
211216
else

0 commit comments

Comments
 (0)