[#7617] improvement(cli): ADD Error handling and absolute path resolution in gcli.sh #7620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Added
set -e
to ensure the script exits immediately upon any command failure.Resolved the
bin
directory path to an absolute path to ensure consistent behavior regardless of the script's invocation location.Implemented proper error handling when the
CLI_JAR
is missing or not found, with a clear and informative error message.Why are the changes needed?
Fix: #7617
Does this PR introduce any user-facing change?
If the CLI JAR is missing, users will now see a clear error message.
The CLI script will behave consistently, even when executed from different directories.
How was this patch tested?
Manually ran the updated gcli.sh script with and without the CLI JAR present.
Verified the script terminates correctly with an error when the JAR is missing.
Confirmed the correct JAR is found and launched when present, from various working directories.