diff --git a/readme.md b/readme.md index feda64497..1407e0cfc 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Introduction -Welcome to TiddlyWiki5, a complete rewrite of TiddlyWiki, the reusable non-linear personal web notebook first released in 2004. +Welcome to TiddlyWiki5, a complete rewrite of TiddlyWiki, the reusable non-linear personal web notebook that was first released in 2004. TiddlyWiki5 is an interactive wiki written in JavaScript to run in the browser or under node.js. For full documentation, see the finished build at http://tiddlywiki.com/tiddlywiki5/. diff --git a/upload.sh b/upload.sh new file mode 100755 index 000000000..a3b2e0067 --- /dev/null +++ b/upload.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Upload the latest build of tiddlywiki5 to the server at http://www.tiddlywiki.com/ + +# Usage: +# upload [user] + +# default values +REMOTE_USER=${1:-$USER} +FROMDIR=$PWD/tmp/tw5 +HOST="tiddlywiki.com" +DIR="/var/www/www.tiddlywiki.com/htdocs/tiddlywiki5" +OWNER="www-data:www-data" +PERM="664" + +# setPermissions() +# Usage: +# setPermissions file +function setPermissions() { + COMMANDS="$COMMANDS sudo chown $OWNER $1;" + COMMANDS="$COMMANDS sudo chmod $PERM $1;" +} + +echo "uploading files" + +FILES="$FROMDIR/index.html $FROMDIR/index.xml" +scp $FILES "$REMOTE_USER@$HOST:$DIR" + +echo "setting file permissions" + +COMMANDS="ssh $REMOTE_USER@$HOST" +setPermissions "$DIR/index.html" +setPermissions "$DIR/index.xml" + +# execute +COMMANDS="$COMMANDS exit;" +$COMMANDS