Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #39 from logological/fixshell
Browse files Browse the repository at this point in the history
Delint build script. ExchangeCalendar/exchangecalendar/#38
  • Loading branch information
advancingu authored Jun 28, 2017
2 parents 8c2151d + 7c2a27d commit 2b7bacb
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
#!/bin/sh

usage() { echo "Usage: $0 [-u | -d ]" 1>&2;echo "-u:enable update";echo "-d:disable update"; exit 1; }
usage() {
printf "Usage: %s [ -u | -d ]\n" "$0" 1>&2
printf " -u enable update\n" 1>&2
printf " -d disable update\n" 1>&2
exit 1
}

if [ $# = 0 ];then
usage
if [ $# = 0 ];then
usage
fi

version=`sed -n -e "s/.*<em:version>\(.*\)<\/em:version>/\1/p" install.rdf`
while getopts ":ud" OPTION
version=$(sed -n -e "s/.*<em:version>\(.*\)<\/em:version>/\1/p" install.rdf)
while getopts ":ud" OPTION
do
case ${OPTION} in
u) echo "update"
cat defaults/preferences/update_enable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
cat defaults/preferences/update_enable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v"$version".xpi ./* -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
d) echo "no update"
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v"$version".xpi ./* -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
*) usage ;;
esac
done

usage

usage

0 comments on commit 2b7bacb

Please sign in to comment.