Skip to content

Commit aace2a1

Browse files
Merge pull request #1603 from coderdojo-japan/update_c-search
c-searchで fixie アドレスを使用する
2 parents 410a31b + f9000b5 commit aace2a1

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

bin/c-search

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/bin/sh
2+
ENV_FILE=".env"
3+
4+
if [ ! -f "$ENV_FILE" ]; then
5+
echo "$ENV_FILE が見つかりません"
6+
exit 1
7+
fi
8+
9+
source "$ENV_FILE"
10+
11+
if [ -z "$FIXIE_URL" ]; then
12+
echo "FIXIE_URL が設定されていません"
13+
exit 1
14+
fi
15+
216
if [ $# -eq 0 ]
317
then
418
echo "Usage: c-search [CONNPASS_EVENT_URL | CONNPASS_EVENT_ID]"
519
else
6-
id=`echo $1 | sed -e 's/[^0-9]//g'`
7-
curl -sL "connpass.com/api/v1/event/?event_id=${id}" | jq ".events[].series.id"
20+
id=$(echo $1 | sed -e 's/[^0-9]//g')
21+
curl -x "$FIXIE_URL" -sL "https://connpass.com/api/v1/event/?event_id=${id}" | jq ".events[].series.id"
822
fi
9-
10-

0 commit comments

Comments
 (0)