Skip to content

Instantly share code, notes, and snippets.

@NetzwergX

NetzwergX/wmake.sh

Last active Dec 16, 2015
Embed
What would you like to do?
Build script for WoltLab Community Framework (WCF) packages Automagically builds packages that obey the standard package structure.
#!/bin/bash
#
# Build script for WoltLab Community Framework (WCF) packages
# by Sebastian Teumert (http://www.teumert.net, http://github.com/NetzwergX)
# clear
if ls *.tar > /dev/null 2>&1
then
rm *.tar
fi
packageDir=`pwd`
package=`basename ${packageDir}`
# pack xml files
tar cvf ${package}.tar *.xml
# pack language files
if ls language > /dev/null 2>&1
then
tar -rvf ${package}.tar language/ --exclude-vcs --exclude-backups
fi
# pack sql files
if ls *.sql > /dev/null 2>&1
then
tar -rvf ${package}.tar *.sql --exclude-vcs --exclude-backups
fi
# pack php files
if ls *.php > /dev/null 2>&1
then
tar -rvf ${package}.tar *.php --exclude-vcs --exclude-backups
fi
# pack optionals
if ls optionals > /dev/null 2>&1
then
tar -rvf ${package}.tar optionals/ --exclude-vcs --exclude-backups
fi
# pack requirements
if ls requirements > /dev/null 2>&1
then
tar -rvf ${package}.tar requirements/ --exclude-vcs --exclude-backups
fi
# build file-based PIPs
for dir in */;
do
if [ "${dir}" = 'language/' ] || [ "${dir}" = 'optionals/' ] || [ "${dir}" = 'requirements/' ];
then
continue
else
cd ${dir} && tar cvf ../`basename ${dir}`.tar * --exclude-vcs --exclude-backups > /dev/null 2>&1 && cd ..
tar -rvf ${package}.tar `basename ${dir}`.tar --exclude-vcs --exclude-backups
rm `basename ${dir}`.tar
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.