From 8bea8a98b24100676e67c97030ee7e093d475124 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 5 Oct 2010 23:58:28 +0800 Subject: [PATCH] Don't use any scratch dir, handle write-protected installation --- script/server | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/server b/script/server index da43895fd..c5357a32e 100755 --- a/script/server +++ b/script/server @@ -7,9 +7,13 @@ then echo "Mongod not started" else mkdir -p -v log/thin/ - #force AGPL - tar cf ../_source.tar -X .gitignore * - mv ../_source.tar public/source.tar + #force AGPL + test -w public -a ! -e public/source.tar && + tar cf public/source.tar --exclude='source.tar' -X .gitignore * + test -e public/source.tar || { + echo "Can't find, or even create, public/source.tar. Giving up" + exit 2 + } bundle exec ruby ./script/websocket_server.rb& bundle exec thin start $@ fi