1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 17:10:29 +00:00
TiddlyWiki5/tw2/source/tiddlywiki/uploadalpha
Jeremy Ruston a1c8ac624f Added first pass at support for building TiddlyWiki 2.6.x with TW5
There are still some whitespace and attribute ordering issues, but the
result runs correctly.
2012-05-29 22:02:38 +01:00

55 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Usage:
# uploadalpha [release] [username]
# default values
USERNAME=${2:-$LOGNAME}
DEFAULT_RELEASE=`cat ALPHA`
RELEASE=${1:-$DEFAULT_RELEASE}
HOST="$USERNAME@tiddlywiki.com"
DIR="/var/www/www.tiddlywiki.com/htdocs"
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;"
}
# upload files to temporary folder
echo
echo "uploading files"
echo
FILES="tiddlywiki.$RELEASE.html tiddlywiki_compressed.$RELEASE.html tiddlywiki_externaljs.$RELEASE.html tiddlywiki_externaljs_tiddlyspace.$RELEASE.html twcore.$RELEASE.js jquery/jquery.js jquery/plugins/jQuery.twStylesheet.js"
scp $FILES "$HOST:./tmp/"
# transfer files to their respective folders
echo
echo "transferring files"
echo
stty -echo
COMMANDS="ssh $HOST"
# Empty
COMMANDS="$COMMANDS sudo cp ./tmp/tiddlywiki.$RELEASE.html $DIR/alpha/empty.html;"
setPermissions "$DIR/alpha/empty.html"
# Compressed
COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_compressed.$RELEASE.html $DIR/alpha/tiddlywiki_compressed.html;"
setPermissions "$DIR/alpha/tiddlywiki_compressed.html"
COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_externaljs.$RELEASE.html $DIR/alpha/tiddlywiki_externaljs.html;"
setPermissions "$DIR/alpha/tiddlywiki_externaljs.html"
COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_externaljs_tiddlyspace.$RELEASE.html $DIR/alpha/tiddlywiki_externaljs_tiddlyspace.html;"
setPermissions "$DIR/alpha/tiddlywiki_externaljs_tiddlyspace.html"
COMMANDS="$COMMANDS sudo mv ./tmp/twcore.$RELEASE.js $DIR/alpha/twcore.js;"
setPermissions "$DIR/alpha/twcore.js"
COMMANDS="$COMMANDS sudo mv ./tmp/jquery.js $DIR/alpha/jquery.js;"
setPermissions "$DIR/alpha/jquery.js"
COMMANDS="$COMMANDS sudo mv ./tmp/jQuery.twStylesheet.js $DIR/alpha/jQuery.twStylesheet.js;"
setPermissions "$DIR/alpha/jQuery.twStylesheet.js"
# execute
$COMMANDS
stty echo