-case ${1} in
- -h | --help)
- echo "Usage: git-mirror [path to repos] [path to log file] [html directory]"
- echo "relative paths are not supported."
- exit 1
- ;;
-esac
+usage() {
+ echo 'Usage: git-mirror [command] [arguments]
+ git-mirror run [path to repos] [path to log file] [html directory]
+ optional: [sleep duration]
+ git-mirror gen-url [path to repo] -- generate url file in repo
+ git-mirror help -- show this message
+
+ relative paths are not supported, but globs are.
+ To use, first clone the wanted somewhere repos with the --mirror flag.'
+}
+
+run() {
+ [ -z ${3} ] && echo "not enough arguments" && exit 1
+ [ -z $(which stagit) ] && echo "please install stagit" && exit 1
+ [ -z $(which minify) ] && echo "please install minify" && exit 1
+
+ cd ${1}