File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
3+ if ! command -v curl > /dev/null; then
4+ >&2 echo " WARNING: Could not find curl ( https://curl.haxx.se/ )."
5+ fi
6+
7+ if ! command -v jq > /dev/null; then
8+ >&2 echo " WARNING: Could not find jq ( https://stedolan.github.io/jq/ )."
9+ fi
10+
311__cppsm_complete () {
412 local IFS=$' \t\n '
513 COMPREPLY=()
@@ -17,24 +25,22 @@ __cppsm_complete() {
1725 COMPREPLY=($( compgen -W " equipment requires" -- " $CURRENT " ) )
1826 ;;
1927 clone)
20- if command -v jq > /dev/null && command -v curl > /dev/null && command -v sed > /dev/null ; then
28+ if command -v jq > /dev/null && command -v curl > /dev/null; then
2129 # shellcheck disable=SC2207
2230 COMPREPLY=($( curl -s " https://api.github.com/search/repositories?q=topic:cppsm+${CURRENT##*/ } " | \
2331 jq ' .items | .[] | .ssh_url' ) )
2432 fi
2533 ;;
2634 equipment|requires)
27- if command -v jq > /dev/null && command -v curl > /dev/null && command -v sed > /dev/null ; then
35+ if command -v jq > /dev/null && command -v curl > /dev/null; then
2836 # shellcheck disable=SC2207
2937 COMPREPLY=($( curl -s " https://api.github.com/search/repositories?q=topic:cppsm+${CURRENT##*/ } " | \
3038 jq ' .items | .[] | .clone_url' ) )
3139 fi
3240 ;;
3341 https:* .git|git* .git)
34- if command -v sed > /dev/null; then
35- # shellcheck disable=SC2207
36- COMPREPLY=($( git ls-remote --heads " $PREVIOUS " | sed -e ' s#[^ ]*\s*refs/heads/##g' ) )
37- fi
42+ # shellcheck disable=SC2207
43+ COMPREPLY=($( git ls-remote --heads " $PREVIOUS " | sed -e ' s#[^ ]*\s*refs/heads/##g' ) )
3844 ;;
3945 * )
4046 ;;
You can’t perform that action at this time.
0 commit comments