Skip to content

Commit 6b5e7b8

Browse files
c-searchでfixie アドレスを使用する
1 parent 410a31b commit 6b5e7b8

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bin/c-search

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
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+
211
if [ $# -eq 0 ]
312
then
413
echo "Usage: c-search [CONNPASS_EVENT_URL | CONNPASS_EVENT_ID]"
514
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"
15+
id=$(echo $1 | sed -e 's/[^0-9]//g')
16+
curl -x "$FIXIE_URL" -sL "https://connpass.com/api/v1/event/?event_id=${id}" | jq ".events[].series.id"
817
fi
9-
10-

0 commit comments

Comments
 (0)