diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -18,18 +18,19 @@ print_usage() { echo " -C, chromium: build for Chromium and derivatives" echo " -M, mozilla: build for Firefox and derivatives" echo "options:" - echo " -b, build=[LOC]: set file/directory to use for building" + echo " -b, build=[LOC]: file/directory to use for building" echo " -h, help: print usage information and exit" - echo " -o, output=[LOC]: set output file/directory" - echo " -k, key=[LOC]: select a key to use in building and" - echo " signing a CRX" + echo " -o, output=[LOC]: output file/directory" + echo " -k, key=[LOC]: the key to use in signing a CRX;" + echo " builds a CRX instead of a ZIP" echo " -s, safe: don't delete existing directories;" echo " throw an error instead" + echo " -u, url=[URL]: URL to check for updates" echo " -z, zip: pack the extension as a file" echo echo "environment variables (optional)" - echo " HAKETILO_ZIP: command to use for generating ZIP files" - echo " HAKETILO_CHROMIUM: command to user to invoke Chromium" + echo " HAKETILO_ZIP: command to use for generating ZIP files" + echo " HAKETILO_CHROMIUM: command to use for invoking Chromium" exit $EXIT_STATUS } @@ -38,6 +39,8 @@ print_usage() { BROWSER='' BUILDDIR='' +KEY='' +UPDATE_URL='' MAKEZIP=0 FORCE=1 @@ -53,6 +56,8 @@ while [ "x$1" != x ]; do -o | --output) OUTPUT="$2"; shift;; output=*) OUTPUT="$(echo "$1" | cut -c 8-)";; -s | --safe | safe) FORCE=0;; + -u | --url) UPDATE_URL="$2"; shift;; + url=*) UPDATE_URL="$(echo "$1" | cut -c 5-)";; -z | --zip | zip_ext) MAKEZIP=1;; *) print_usage 2 Unrecognized option "'$1'.";; esac @@ -67,8 +72,10 @@ elif [ "x$KEY" != x ]; then elif [ $MAKEZIP = 0 ]; then print_usage 4 The "'key'" option must be used in conjunction with the "'zip'" option. elif [ ! -e "$KEY" ]; then - print_usage 5 The specified key file "'$KEY'" does not exist. + errcho "The specified key file '$KEY' does not exist." + exit 5 fi + KEY="$(realpath "$KEY")" fi |