diff options
author | louie <lshprung@yahoo.com> | 2021-02-24 13:04:54 -0800 |
---|---|---|
committer | louie <lshprung@yahoo.com> | 2021-02-24 13:04:54 -0800 |
commit | a93ff0e3e6f010087896975f2ba5d5d5b4f78397 (patch) | |
tree | bb2dacd678cca1fb382c2ce6cdbe24d5d39be0da /pkg-screenshot.sh | |
parent | 0f7c20ac391142fbbcc7048447d172cbdb7369d7 (diff) |
Diffstat (limited to 'pkg-screenshot.sh')
-rwxr-xr-x | pkg-screenshot.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg-screenshot.sh b/pkg-screenshot.sh index a10fd05..d9f5f8c 100755 --- a/pkg-screenshot.sh +++ b/pkg-screenshot.sh @@ -20,6 +20,8 @@ case $1 in URL=`wget -qO- https://screenshots.debian.net/json/package/$2 | jq '.screenshots[0].large_image_url' | tr -d \"` if [ -z $URL ]; then echo "Error: Package \"$2\" does not exist" + elif [ $URL = "null" ]; then + echo "Error: Package \"$2\" does not have any screenshots available" else xdg-open $URL fi @@ -34,6 +36,8 @@ case $1 in URL=`wget -qO- https://screenshots.debian.net/json/package/$1 | jq '.screenshots[0].large_image_url' | tr -d \"` if [ -z $URL ]; then echo "Error: Package \"$1\" does not exist" + elif [ $URL = "null" ]; then + echo "Error: Package \"$1\" does not have any screenshots available" else EXTENSION=`echo $URL | rev | cut -d . -f 1 | rev` wget -qO /tmp/pkg-screenshot.$EXTENSION $URL |