Skip to content

Commit

Permalink
⚡ Add check and other requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbarton90 committed Dec 24, 2023
1 parent 0dd81a8 commit c725faa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ auth refresh --scopes notifications`.
The correct scopes can be verified via `gh auth status`. The last line it prints
informs you of the "Token scopes".

Other requirements:
* `gh>=2.40`
* `jq`

## Usage

```shell
Expand Down
13 changes: 13 additions & 0 deletions gh-clean-notifications
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ help() {
echo " -v -> Verbose messaging."
}

check() {
has_jq=$(which jq)
has_jq=$?
if [ ${VERBOSE} -gt 0 ]; then
echo "Has jq: ${has_jq}"
fi

if [[ $has_jq != "0" ]]; then
echo "jq is not installed. Please install jq."
exit 1
fi
}

process_notifications() {
data=$(gh api graphql \
-F first="${BASE_LIMIT}" -F miscQuery="${BASE_QUERY}" \
Expand Down

0 comments on commit c725faa

Please sign in to comment.