Skip to content

Commit c1c0e51

Browse files
committed
simplize shell
1 parent 2a560d6 commit c1c0e51

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

misc/packagecloud.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ check_jq() {
1010
}
1111

1212
list() {
13-
if [ $PACKAGECLOUD_TOKEN = "" ]; then
13+
if [ "$PACKAGECLOUD_TOKEN" = "" ]; then
1414
echo '$PACKAGECLOUD_TOKEN is required'
1515
exit 1
1616
fi
@@ -31,8 +31,7 @@ find() {
3131
fi
3232

3333
number=$(cat distributions.json | \
34-
jq ".deb[] | select(.index_name == \"$os\") | .versions[] | {\"id\":.id,\"name\":.index_name}" | \
35-
jq -s | jq ".[] | select(.name == \"$code\") | .id")
34+
jq ".deb[] | select(.index_name == \"$os\") | .versions[] | {\"id\":.id,\"name\":.index_name} | select(.name == \"$code\") | .id")
3635

3736
printf "$number"
3837
}

0 commit comments

Comments
 (0)