Skip to content
This repository
Browse code

verify if the user entered something in echo

  • Loading branch information...
commit 7cbdeecb4f5bd93ee9c0a962578171aca7dbbad5 1 parent 703a05f
Geoffroy Couprie authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 echo/echo.sh
7 echo/echo.sh
... ... @@ -1,3 +1,8 @@
1 1 #!/bin/sh
2 2
3   -echo "{ \"version\": 1, \"title\": \"Echo\", \"type\":\"commands\", \"values\" : [ { \"name\" : \"Echo\", \"value\" : \"$1\", \"command\" : \"\"} ] }";
  3 +if [ "$#" -ne 1 ]
  4 +then
  5 + echo '{ "version": 1, "title": "Echo", "type":"status", "status":"error", "message":"Please enter something" }';
  6 +else
  7 + echo "{ \"version\": 1, \"title\": \"Echo\", \"type\":\"commands\", \"values\" : [ { \"name\" : \"Echo\", \"value\" : \"$1\", \"command\" : \"\"} ] }";
  8 +fi

0 comments on commit 7cbdeec

Please sign in to comment.
Something went wrong with that request. Please try again.