File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55#
66# Usage: source load-env.sh
77
8- SCRIPT_DIR=" $( dirname " $( readlink -f " $0 " ) " ) "
8+ SCRIPT_DIR=" $( dirname " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
99readonly SCRIPT_DIR
1010
1111# Get the environment variables inside a function so that the set -o options
@@ -30,10 +30,16 @@ function get_env_vars() {
3030 return 1
3131 fi
3232
33- WORKSPACE_ID=" $( jq -er ' .workspace.userFacingId' " ${CONTEXT_PATH} " ) "
33+ if ! WORKSPACE_ID=" $( jq -er ' .workspace.userFacingId' " ${CONTEXT_PATH} " ) " ; then
34+ echo " Workspace ID is not set in ${CONTEXT_PATH} ." >&2
35+ return 1
36+ fi
3437 readonly WORKSPACE_ID
3538
36- WSM_API_URL=" $( jq -er ' .server.workspaceManagerUri' " ${CONTEXT_PATH} " ) "
39+ if ! WSM_API_URL=" $( jq -er ' .server.workspaceManagerUri' " ${CONTEXT_PATH} " ) " ; then
40+ echo " WSM API URL is not set in ${CONTEXT_PATH} ." >&2
41+ return 1
42+ fi
3743 readonly WSM_API_URL
3844
3945 if wb auth status 2>&1 | grep -q " NO USER LOGGED IN" ; then
You can’t perform that action at this time.
0 commit comments