Skip to content

c-searchで fixie アドレスを使用する #1603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions bin/c-search
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
#!/bin/sh
ENV_FILE=".env"

if [ ! -f "$ENV_FILE" ]; then
echo "$ENV_FILE が見つかりません"
exit 1
fi

source "$ENV_FILE"
Comment on lines +2 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXIE_URLが設定されているかどうかを確認したほうが良いかもですね😊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuppymam
f9000b5 で対応しました!


if [ -z "$FIXIE_URL" ]; then
echo "FIXIE_URL が設定されていません"
exit 1
fi

if [ $# -eq 0 ]
then
echo "Usage: c-search [CONNPASS_EVENT_URL | CONNPASS_EVENT_ID]"
else
id=`echo $1 | sed -e 's/[^0-9]//g'`
curl -sL "connpass.com/api/v1/event/?event_id=${id}" | jq ".events[].series.id"
id=$(echo $1 | sed -e 's/[^0-9]//g')
curl -x "$FIXIE_URL" -sL "https://connpass.com/api/v1/event/?event_id=${id}" | jq ".events[].series.id"
fi