2012-11-16 17:01:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
# build the TiddlyWeb edition of TiddlyWiki5 and upload it to TiddlySpace. Requires the TiddlySpace credentials
|
|
|
|
# of a member of the tw5tiddlyweb space
|
2012-11-16 17:01:04 +00:00
|
|
|
|
|
|
|
# usage:
|
|
|
|
# ./wbld.sh <tiddlyspace username> <tiddlyspace password>
|
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
# Create the tmp directory if needed
|
2012-11-16 17:01:04 +00:00
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
mkdir -p tmp
|
|
|
|
|
|
|
|
# Open the tw5tiddlyweb edition in TW5 and save the template for the main HTML file
|
|
|
|
|
|
|
|
node ./tiddlywiki.js \
|
|
|
|
editions/tw5tiddlyweb \
|
2012-11-16 17:01:04 +00:00
|
|
|
--verbose \
|
2013-11-08 08:51:14 +00:00
|
|
|
--rendertiddler $:/core/templates/tiddlywiki5.template.html tmp/tiddlyweb.html text/plain \
|
2012-11-16 17:01:04 +00:00
|
|
|
|| exit 1
|
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
# Prepend the type information that TiddlyWeb needs to turn the .html file into a .tid file
|
2012-11-16 17:01:04 +00:00
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
echo "type: text/html" > tmp/tiddlerforupload.txt
|
|
|
|
echo "" >> tmp/tiddlerforupload.txt
|
|
|
|
cat tmp/tiddlyweb.html >> tmp/tiddlerforupload.txt
|
2012-11-16 17:01:04 +00:00
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
# Upload the tiddler file
|
2012-11-29 21:30:53 +00:00
|
|
|
|
2013-03-06 16:45:13 +00:00
|
|
|
curl -u $1:$2 -X PUT -H "content-type: text/plain" http://tw5tiddlyweb.tiddlyspace.com/bags/tw5tiddlyweb_public/tiddlers/tw5 --data-binary @tmp/tiddlerforupload.txt
|