diff --git a/bin/webskel b/bin/webskel old mode 100644 new mode 100755 index e69de29..7df7eac --- a/bin/webskel +++ b/bin/webskel @@ -0,0 +1,30 @@ +#!/bin/sh +set -e + +## +# variables +localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/..)} +libexec="${localbase}"/libexec/webskel + +## +# functions +# shellcheck source=/dev/null +. "${libexec}"/functions/print.sh + +## +# main +case $1 in + "new") + "${libexec}"/commands/new + ;; + "ls") + "${libexec}"/commands/ls + ;; + *) + printf "Usage: webskel COMMAND [OPTIONS]\n" + printf "\n" + printf "General\n" + printf " new Create a new project from a specified skeleton\n" + printf " ls List available skeletons\n" + ;; +esac diff --git a/libexec/webskel/functions/print.sh b/libexec/webskel/functions/print.sh new file mode 100755 index 0000000..4a84981 --- /dev/null +++ b/libexec/webskel/functions/print.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +printok() +{ + if [ -e /dev/stdout ]; then + printf "webskel: %s\n" "${1}" > /dev/stdout + else + printf "webskel: %s\n" "${1}" + fi +} + +printerr() +{ + if [ -e /dev/stderr ]; then + printf "webskel: %s\n" "${1}" > /dev/stderr + else + printf "webskel: %s\n" "${1}" + fi +}