Skip to content

Commit d8c158e

Browse files
authored
#260: Implement exit code in wrapper script (#270)
1 parent 3df645d commit d8c158e

File tree

1 file changed

+6
-7
lines changed
  • cli/src/main/package/bin

1 file changed

+6
-7
lines changed

cli/src/main/package/bin/ide

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/usr/bin/env bash
22

3-
# immediately exit on errors
4-
set -e
5-
6-
# Check if arguments are given
7-
if [ -n "${1}" ]; then
8-
# Call native ideasy with user-provided arguments
9-
ideasy "$@"
3+
# Call native ideasy with user-provided arguments
4+
ideasy "$@"
5+
return_code=$?
6+
if [ $return_code -ne 0 ]; then # Check if ideasy exit code is not equal to 0
7+
echo -e "\n\033[91mError: IDEasy failed with exit code $return_code \033[91m" >&2 # Print error message to stderr
8+
return $return_code # Return the same error code as ideasy
109
fi
1110

1211
ide_env=

0 commit comments

Comments
 (0)