Here is a script that automates downloading and building the latest version of a Content Spec: -------------------------------------------------------------- #!/bin/bash SPECID=14 SPECNAME=Writing_with_Topics DIR=`pwd` rm -rf $SPECNAME rm $SPECNAME.zip java -jar ~/Skynet/skynet.jar build $SPECID unzip $SPECNAME.zip cd $SPECNAME publican build --formats=html-single --langs=en-US #google-chrome file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html #Use the locally configured default web browser xdg-open file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html ---------------------------------------------- This could be improved by making a csprocessor.cfg file that contains the SPECID and SPECNAME attributes. Then the buildit script could be an aliased command, and it could be run wherever a csprocessor.cfg file is located. It reads the SPECID and SPECNAME from the config file.
OK, here it is: ---------------------------------------------------------------------- #!/bin/bash SKYNETCLIENTCMD="java -jar /home/jwulf/Skynet/skynet.jar" DIR=`pwd` CONFFILE=csprocessor.cfg if [ ! -f $CONFFILE ] then echo "Cannot find $CONFFILE. Exiting." exit 2 else source $CONFFILE fi if [ -z "$SPECID" ] then echo "Please set a value for SPECID in $CONFFILE" exit 3 fi if [ -z "$SPECNAME" ] then echo "Please set a value for SPECNAME in $CONFFILE" exit 3 fi rm -rf $SPECNAME rm $SPECNAME.zip $SKYNETCLIENTCMD build $SPECID unzip $SPECNAME.zip cd $SPECNAME publican build --formats=html-single --langs=en-US #google-chrome file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html xdg-open file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html ---------------------------------------------------------- Here's how to set it up: Copy the script above and put it into a file like ~/skynet/buildit.sh. Modify the value of SKYNETCLIENTCMD in the script to point to your local installation of the skynet client. Make it executable with "chmod 755 buildit.sh". Edit ~/.bashrc and add a line to point to the buildit.sh script: alias buildit='~/skynet/buildit.sh' Reload your environment with "source ~/.bashrc" Now create a csprocessor.cfg with the following syntax: ----------------------------------- SPECID=14 SPECNAME=Writing_with_Topics ----------------------------------- Then just run "buildit" in the same directory as the csprocessor.cfg file. The script will delete the previously downloaded zip and the extracted files, contact the webservice to get the latest build as a zip, extract it, build it with publican, and then open it for preview in your browser. Enjoy!
This version will copy in a custom entities file. Just put the entities file next to the csprocessor.cfg file. Whenever you build, the custom entities file will be copied into the correct location. ------------------------------------------------------------------- #!/bin/bash SKYNETCLIENTCMD="java -jar /home/jwulf/Skynet/skynet.jar" DIR=`pwd` CONFFILE=csprocessor.cfg if [ ! -f $CONFFILE ] then echo "Cannot find $CONFFILE. Exiting." exit 2 else source $CONFFILE fi if [ -z "$SPECID" ] then echo "Please set a value for SPECID in $CONFFILE" exit 3 fi if [ -z "$SPECNAME" ] then echo "Please set a value for SPECNAME in $CONFFILE" exit 3 fi rm -rf $SPECNAME rm $SPECNAME.zip $SKYNETCLIENTCMD build $SPECID unzip $SPECNAME.zip # Copy a custom entities file, if one exists next to the csprocessor.cfg file if [ -f $SPECNAME.ent ] then cp $SPECNAME.ent $SPECNAME/en-US/$SPECNAME.ent fi cd $SPECNAME cd $SPECNAME publican build --formats=html-single --langs=en-US #google-chrome file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html xdg-open file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html
#!/bin/bash SKYNETCLIENTCMD="csprocessor" DIR=`pwd` # Note that this script fails when the path of the current working directory contains spaces # To fix this, a function should be added to escape characters in the xdg-open argument CONFFILE=csprocessor.cfg if [ ! -f $CONFFILE ] then echo "Cannot find $CONFFILE. Exiting." exit 2 else source $CONFFILE fi if [ -z "$SPECID" ] then echo "Please set a value for SPECID in $CONFFILE" exit 3 fi if [ -z "$SPECNAME" ] then echo "Please set a value for SPECNAME in $CONFFILE" exit 3 fi if [ -f $SPECNAME.zip ] then rm $SPECNAME.zip fi rm -rf $SPECNAME $SKYNETCLIENTCMD build $SPECID unzip $SPECNAME.zip rm $SPECNAME.zip cd $SPECNAME publican build --formats=html-single --langs=en-US # The command below will fail if there are spaces in the path name # WORKAROUND: Make sure no directories in the path have spaces in them. Use _ instead xdg-open file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html
Below is a fix to allow Working Directories to have spaces in them. #!/bin/bash SKYNETCLIENTCMD="csprocessor" DIR=`pwd` CONFFILE=csprocessor.cfg if [ ! -f $CONFFILE ] then echo "Cannot find $CONFFILE. Exiting." exit 2 else source $CONFFILE fi if [ -z "$SPECID" ] then echo "Please set a value for SPECID in $CONFFILE" exit 3 fi if [ -z "$SPECNAME" ] then echo "Please set a value for SPECNAME in $CONFFILE" exit 3 fi if [ -f $SPECNAME.zip ] then rm $SPECNAME.zip fi rm -rf $SPECNAME $SKYNETCLIENTCMD build $SPECID unzip $SPECNAME.zip rm $SPECNAME.zip cd $SPECNAME publican build --formats=html-single --langs=en-US # Open the index.html file xdg-open "file://$DIR/$SPECNAME/tmp/en-US/html-single/index.html"
Functionality implemented by 796009 *** This bug has been marked as a duplicate of bug 796009 ***