Simplify windows install

Don't download node.exe and jquery on install
Check node version
Exit on error
This commit is contained in:
Marcel Klehr 2012-08-01 15:51:14 +02:00
parent a2bf577393
commit df38915b63
1 changed files with 11 additions and 14 deletions

View File

@ -1,22 +1,15 @@
@echo off
set NODE_VERSION=0.8.1
set JQUERY_VERSION=1.7
:: change directory to etherpad-lite root
cd bin
cd ..
cd /D "%~dp0\.."
echo _
echo Updating node...
curl -lo bin\node.exe http://nodejs.org/dist/v%NODE_VERSION%/node.exe
echo Checking node version...
set check_version="if(['6','8'].indexOf(process.version.split('.')[1].toString()) === -1) { console.log('You are running a wrong version of Node. Etherpad Lite requires v0.6.x or v0.8.x'); process.exit(1) }"
cmd /C node -e %check_version% || exit /B 1
echo _
echo Installing etherpad-lite and dependencies...
cmd /C npm install src/
echo _
echo Updating jquery...
curl -lo "node_modules\ep_etherpad-lite\static\js\jquery.min.js" "http://code.jquery.com/jquery-%JQUERY_VERSION%.min.js"
cmd /C npm install src/ || exit /B 1
echo _
echo Copying custom templates...
@ -27,12 +20,16 @@ FOR %%f IN (index pad timeslider) DO (
)
echo _
echo Clearing cache.
echo Clearing cache...
del /S var\minified*
echo _
echo Setting up settings.json...
IF NOT EXIST settings.json copy settings.json.template settings.json
IF NOT EXIST settings.json (
echo Can't find settings.json.
echo Copying settings.json.template...
cmd /C copy settings.json.template settings.json || exit /B 1
)
echo _
echo Installed Etherpad-lite!