Check-in [f2566d10e2]
Overview
Comment:Better error handling
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f2566d10e234a256dbcf02e9ca3fca929dd56105
User & Date: rkeene on 2019-02-28 10:29:12
Other Links: manifest | tags
Context
2019-04-10
16:05
Upgrade TclTLS to 1.7.17 check-in: e6ede3bbb5 user: rkeene tags: trunk
2019-02-28
10:29
Better error handling check-in: f2566d10e2 user: rkeene tags: trunk
10:19
More better API check-in: f8c7c20a57 user: rkeene tags: trunk
Changes

Modified build/utils/download-api-client from [8826872ee9] to [45c8f50b64].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30



31
32
33
34
35
36
37
#! /usr/bin/env bash

# Define endpoint
endpoint_url="https://kitcreator.rkeene.org/kitcreator"

# Help
function print_help() {
	echo 'download-api-client [--platform <platform>] [--tcl-version <version>]'
	echo '                    [--kitcreator-version <version>] [--kitdll]'
	echo '                    [--threaded] [--debug] [--dynamictk]'
	echo '                    [--staticpkgs]'
	echo 'download-api-client {--help|--platforms|--tcl-versions|'
	echo '                     --kitcreator-versions|--packages}'
}

# Set arguments
declare -A jsonArgs
jsonArgs["platform"]="$(uname -s)-$(uname -m)"

nextArg=''
kit_filename=''
options=()

for arg in "$@"; do
	if [ -n "${nextArg}" ]; then
		jsonArgs["${nextArg}"]="${arg}"
		nextArg=''
		continue
	fi

	case "${arg}" in



		--platform|--tcl-version|--kitcreator-version)
			nextArg="${arg:2}"
			nextArg="${nextArg//-/_}"
			;;
		--kitdll|--threaded|--debug|--dynamictk|--staticpkgs)
			options+=("${arg:2}")
			;;










|











>








>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/env bash

# Define endpoint
endpoint_url="https://kitcreator.rkeene.org/kitcreator"

# Help
function print_help() {
	echo 'download-api-client [--platform <platform>] [--tcl-version <version>]'
	echo '                    [--kitcreator-version <version>] [--kitdll]'
	echo '                    [--threaded] [--debug] [--dynamictk]'
	echo '                    [--staticpkgs] [--verbose]'
	echo 'download-api-client {--help|--platforms|--tcl-versions|'
	echo '                     --kitcreator-versions|--packages}'
}

# Set arguments
declare -A jsonArgs
jsonArgs["platform"]="$(uname -s)-$(uname -m)"

nextArg=''
kit_filename=''
options=()
internalOptionsVerbose='false'
for arg in "$@"; do
	if [ -n "${nextArg}" ]; then
		jsonArgs["${nextArg}"]="${arg}"
		nextArg=''
		continue
	fi

	case "${arg}" in
		--verbose)
			internalOptionsVerbose='true'
			;;
		--platform|--tcl-version|--kitcreator-version)
			nextArg="${arg:2}"
			nextArg="${nextArg//-/_}"
			;;
		--kitdll|--threaded|--debug|--dynamictk|--staticpkgs)
			options+=("${arg:2}")
			;;
109
110
111
112
113
114
115
116

117

118
119
120
121
122
123
124
build_log_url="$(jq -crM .build_log_url <<<"${info}")"

if [ -n "${buildStatusWroteHeader}" ]; then
	echo " ${status}"
fi

if [ "${status}" != "complete" ]; then
	echo "failed: ${status}" >&2

	curl -sSL "${build_log_url}" >&2


	exit 1
fi

kit_url="$(jq -crM .kit_url <<<"${info}")"
if [ -z "${kit_filename}" ]; then
	kit_filename="${kit_url//*\//}"







|
>
|
>







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
build_log_url="$(jq -crM .build_log_url <<<"${info}")"

if [ -n "${buildStatusWroteHeader}" ]; then
	echo " ${status}"
fi

if [ "${status}" != "complete" ]; then
	echo "${status}: Build terminated in error" >&2
	if [ "${internalOptionsVerbose}" = 'true' ]; then
		curl -sSL "${build_log_url}" >&2
	fi

	exit 1
fi

kit_url="$(jq -crM .kit_url <<<"${info}")"
if [ -z "${kit_filename}" ]; then
	kit_filename="${kit_url//*\//}"