@@ -18,7 +18,7 @@ show_usage() {
1818 echo " --hosting-base-path Optional. Base path for static hosting (default: TARGET name, use empty string \"\" for root)"
1919
2020 echo
21- echo " The documentation ends up in .build/docs-<PLATFORM>."
21+ echo " The web transformed documentation ends up in .build/docs-<PLATFORM>."
2222
2323 echo
2424 echo " Examples:"
9090
9191# If no TARGET was provided, try to get package name
9292if [ -z " $TARGET " ]; then
93- # Use the script folder to refer to other scripts
9493 FOLDER=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) "
95- SCRIPT_PACKAGE_NAME=" $FOLDER /package_name.sh"
96-
97- # Check if package_name.sh exists
98- if [ -f " $SCRIPT_PACKAGE_NAME " ]; then
99- echo " No target provided, attempting to get package name..."
100- if TARGET=$( " $SCRIPT_PACKAGE_NAME " ) ; then
101- echo " Using package name: $TARGET "
102- else
103- echo " "
104- read -p " Failed to get package name. Please enter the target to build documentation for: " TARGET
105- if [ -z " $TARGET " ]; then
106- show_error_and_exit " TARGET is required"
107- fi
108- fi
109- else
110- echo " "
111- read -p " Please enter the target to build documentation for: " TARGET
112- if [ -z " $TARGET " ]; then
113- show_error_and_exit " TARGET is required"
114- fi
94+ SCRIPT_PACKAGE_NAME=" $FOLDER /package-name.sh"
95+
96+ if [ ! -f " $SCRIPT_PACKAGE_NAME " ]; then
97+ show_error_and_exit " Script not found: $SCRIPT_PACKAGE_NAME "
98+ fi
99+
100+ if ! TARGET=$( " $SCRIPT_PACKAGE_NAME " ) ; then
101+ show_error_and_exit " Failed to get package name"
115102 fi
116103fi
117104
0 commit comments