Skip to content

Commit a02cfe3

Browse files
committed
[catalog] v0.3.2
add helper to `-d` for "beta"
1 parent acd64d6 commit a02cfe3

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.DS_Store

catalog/README

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,23 @@ OPTIONS
4343
This option allows querying a specified domain,
4444
overriding the value set in the .inst config file.
4545

46+
A helper is provided for "beta", reserving it for use with
47+
the domain provided in the .inst config file. Using the
48+
reserved word will not require the -t option to be included
49+
as described below. E.g. the config file has the a stored
50+
token and a value for canvas_domain of "foobar", in
51+
order to connect to https://foobar.beta.instructure.com
52+
simply use "-d beta"
53+
4654
The value only requires the subdomain string of
4755
catalogapp.com. E.g. if the desired domain to query
4856
is https://foobar.catalog.instructure.com then pass the option
4957
"-d foobar"
5058

5159
-d also requires that -t <token> be included
52-
in the query. catalog will not allow you to pass one
53-
authentication parameter and read the others from config.
60+
in the query unless the value of -d is "beta".
61+
canvas will not allow you to pass one authentication
62+
parameter and read the others from config.
5463

5564
-F <name=content>
5665
The Form option transparently passes to curl. Please read

catalog/catalog

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ usage() {
166166

167167
version() {
168168
logo
169-
echo >&2 " catalog-cli version 0.3.1"
169+
echo >&2 " catalog-cli version 0.3.2"
170170
exit
171171
}
172172

@@ -175,13 +175,6 @@ license() {
175175
exit
176176
}
177177

178-
examples() {
179-
echo >&2 "$0 courses";
180-
echo >&2 "$0 -x PUT users/self/settings -F 'manual_mark_as_read=false'";
181-
echo >&2 "$0 <token> DELETE <domain> users/self/activity_stream";
182-
echo >&2 "$0 <token> POST <domain> users/self/files -F 'url=http://www.canvaslms.com/img/logo_instructure.png' -F 'name=instructure.png'";
183-
}
184-
185178
# HANDLE DEPENDENCIES ##########################################################
186179
# Requires: jsontool (npm), pygmentize (pip), curl, and getopts #
187180
# ##############################################################################
@@ -429,7 +422,11 @@ fi
429422

430423
if [ -z "$catalog_domain" ] && [ -z "$catalog_token" ]; then
431424
readconfig
432-
elif [ -z "$catalog_domain" ] || [ -z "$catalog_token" ]; then
425+
elif [ $catalog_domain = "beta" ]; then
426+
sd=$catalog_domain
427+
readconfig
428+
canvas_domain="$catalog_domain.$sd"
429+
elif [ -z "$catalog_domain" ] || [ -z "$catalog_domain" ]; then
433430
echo >&2 "Both \`-d\` and \`-t\` are requied when not using a config file"
434431
usage
435432
exit 2

0 commit comments

Comments
 (0)