@echo off REM Clone an Enano Mercurial repository and set up local symlinks. REM Requires Windows Vista or 7! REM REM Written by Dan Fuhry. Public domain. set ERRORLEV=0 echo This script pulls the latest Enano from Mercurial and sets echo up a development-safe repository. echo. echo Windows Vista or 7 and TortoiseHg (tortoisehg.org) are required. echo. if x%1 == x ( set vers= set /P vers= Version to pull [1.1]: if x%vers% NEQ x goto HAVEVERS set vers=1.1 :HAVEVERS echo. ) else ( set vers=%1 ) if not exist enano-%vers% goto NERREXIST echo The directory enano-%vers% already exists. Please delete it if echo you want to start a new repository. set %ERRORLEVEL%=1 goto EOF :NERREXIST echo Performing symlink test... md __testa mklink /D __testb __testa >NUL if %ERRORLEVEL% == 0 goto NERRSYMLINK rmdir /S /Q __testa __testb >NUL 2>NUL echo. echo Could not create a test symlink. Make sure you are running this batch echo file with administrator rights and that your Windows installation has echo the "mklink" command (probably Vista and 7 only). set ERRORLEV=1 goto EOF :NERRSYMLINK rmdir /S /Q __testa __testb >NUL 2>NUL md enano-%vers% cd enano-%vers% md repo echo Pulling from http://hg.enanocms.org/repos/enano-%vers%/ ... hg clone http://hg.enanocms.org/repos/enano-%vers%/ repo if %ERRORLEVEL% == 0 goto NERRHG echo Mercurial clone operation failed. Ensure that Mercurial is installed, echo and that it can reach the Internet. set ERRORLEV=1 goto EOF :NERRHG echo Creating file symlinks... for %%F IN (ajax.php,cron.php,GPL,index.php,README,upgrade.sql,install.php,schema.sql,upgrade.php,web.config) DO ( if exist repo\%%F mklink .\%%F repo\%%F>NUL ) echo Creating directory symlinks... for %%F IN (images,includes,install,language,licenses) DO ( if exist repo\%%F mklink /D .\%%F repo\%%F>NUL ) echo Setting up files and cache directories... for %%D IN (cache,files) DO ( md %%D cd %%D mklink index.php ..\repo\%%D\index.php>NUL mklink .htaccess ..\repo\%%D\.htaccess>NUL cd .. ) echo Setting up plugins and themes directories... for %%D IN (plugins,themes) DO ( md %%D cd repo\%%D for %%d IN (*) DO mklink ..\..\%%D\%%d ..\repo\%%D\%%d>NUL for /D %%d IN (*) DO mklink /D ..\..\%%D\%%d ..\repo\%%D\%%d>NUL cd ..\.. ) echo Creating config files... echo. >NUL 2> config.new.php echo. >NUL 2> .htaccess.new echo. >NUL 2> .enanodev echo Done! cd .. :EOF echo. pause exit /B %ERRORLEV%