Created
April 1, 2014 15:17
-
-
Save stgnet/9916277 to your computer and use it in GitHub Desktop.
Build FreePBX module tgz for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# build test version of module | |
set -e | |
[ ! -f module.xml ] && echo "ERROR: module.xml not found!" && exit 1 | |
MODNAME=$(xmllint --shell module.xml <<<"cat /module/rawname/text()" |grep -v "^/") | |
VERSION=$(xmllint --shell module.xml <<<"cat /module/version/text()" |grep -v "^/") | |
[ -z "$MODNAME" -o -z "$VERSION" ] && echo "ERROR: module name and version missing from module.xml" && exit 2 | |
cd .. | |
[ ! -d "$MODNAME" ] && echo "ERROR: directory $PWD/$MODNAME not found!" && exit 3 | |
tar cvfz $MODNAME-$VERSION.tgz --exclude .git $MODNAME | |
echo "Built module for testing: $(readlink -f $MODNAME-$VERSION.tgz)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment