Created
August 20, 2016 19:44
-
-
Save vigorouscoding/ee1a36e5af7ecd3e55dd442cbce80de2 to your computer and use it in GitHub Desktop.
structr helpers for bash_profile
This file contains 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
backup_structr() { | |
[ ! -d files ] || [ ! -d db ] && echo "db and files must be present. not in structr-ui folder?" && return 1 | |
local OPT="" | |
[ ! -z $1 ] && OPT="-"$1 && OPT=${OPT//[^a-zA-Z0-9-_]/} | |
local BAKFILE=db-files-$(date +%Y%m%d-%H%M%S)$OPT.tar.bz2 | |
echo "backing up to "$BAKFILE | |
tar cvfj $BAKFILE db files | |
} | |
cdstructr() { | |
cd ~/Documents/structr/structr-ui | |
} | |
structr() { | |
COMPILE="mvn clean install -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dgpg.skip=true -DskipDeb=true -Dassembly.skipAssembly=true" | |
CURDIR=`basename $(pwd)` | |
RESULT=0 | |
if [ "$CURDIR" = "structr-ui" ] | |
then | |
cd ..; | |
$COMPILE; | |
RESULT=$?; | |
cd structr-ui; | |
if [ $RESULT -eq 0 ] | |
then | |
./copy-modules.sh | |
./run_debug.sh; | |
else | |
echo "Compilation failed - please see the above error messages!"; | |
fi | |
else | |
if [ "$CURDIR" = "structr" ] | |
then | |
$COMPILE; | |
RESULT=$?; | |
cd structr-ui; | |
if [ "$RESULT" -eq 0 ] | |
then | |
./copy-modules.sh | |
./run_debug.sh; | |
else | |
echo "Compilation failed - please see the above error messages!"; | |
fi | |
else | |
echo "Not in a structr directory." | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment