diff --git a/stpkg b/stpkg index 26e0483b16f6e3e8c8e944f0bdc611aa6bb7dccb..9d14d62b231579ca0abbad8270c703ea542783af 100755 --- a/stpkg +++ b/stpkg @@ -99,7 +99,7 @@ cat << EOF `__bold Flags:` `__yellow "-e"` / `__yellow "-ne"` The pack is enabled / disabled `__yellow "-p"` / `__yellow "-np"` The pack is present / not present in the sticker repo - `__yellow "-t"` Matrix user token + `__yellow "-t"` Matrix user token, let empty to fill it on stdin `__yellow "-dl"` Specify a folder to dl, may exists or not `__bold Configuration variables from $(echo '~/.config/stpkg.sh'):` @@ -118,7 +118,7 @@ cat << EOF `__bold Requirements:` The stpkg command requires `__italic $(__yellow 'egrep')`. If `__italic $(__yellow 'egrep')` is not found, `__italic $(__yellow 'grep')` will be - used instead. Here is a list of all the requirements: + used instead. Here is a list of all the requirements (that should be checked automatically): $REQUIREMENTS EOF exit 0 @@ -149,7 +149,7 @@ validate_token() { validate_homeserv() { curl "https://$STPKG_HOMESERV" >/dev/null 2>&1 - [ $? -ne 0 ] && die "Homeserver '$STPKG_HOMESERV' doesn't exist or is inacessible" + [ $? -ne 0 ] && die "Homeserver '$STPKG_HOMESERV' doesn't exist or is inaccessible" } file_get_width() { @@ -477,7 +477,7 @@ __display() { fi local FILE="${STPKG_INSTALL}web/packs/$1.json" - [ ! -r "$FILE" ] && die "Pack '$1' is not available (check with 'pack list'). The corresponfig file should be '$FILE'" + [ ! -r "$FILE" ] && die "Pack '$1' is not available (check with 'pack list'). The corresponding file should be '$FILE'" echo "Display the sticker pack $(__green `jq '.title' < "$FILE"`):" local FIRST="yes" @@ -676,7 +676,7 @@ __pack() { fi fi local PACK_NAME=`slugify $PACK_NAME` info "Will pack the folder '$PACK_FOLDER' into '$PACK_NAME'" - [ ! -d "$PACK_FOLDER" ] && die "Source folder '$PACK_FOLDER' doesn't exsit" + [ ! -d "$PACK_FOLDER" ] && die "Source folder '$PACK_FOLDER' doesn't exist" # Check packs local DEST_FOLDER="$STPKG_BASE/packs/$PACK_NAME" @@ -755,10 +755,6 @@ __pack() { info "Pack created, you can now commit it and create a MR to share it with other users" } -###################### -# Parse command line # -###################### - __do_command() { case "$1" in show|update|list|add|del|default|pack|display|edit) @@ -813,6 +809,9 @@ __do_command() { $* } +###################### +# Parse command line # +###################### [ "x$1" = "x" ] && usage case "$1" in show) __do_command show ;;