Skip to content

Commit

Permalink
improved update script
Browse files Browse the repository at this point in the history
  • Loading branch information
codler committed Feb 27, 2011
1 parent 23f5a2e commit 60d96c9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
1 change: 1 addition & 0 deletions build/options.bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jquery:1.5.1
44 changes: 32 additions & 12 deletions build/update.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off
@setlocal

REM Settings
set version=1
Expand All @@ -15,10 +16,13 @@ REM Get versions
wget.exe %server%versions%version%.txt /output versions.txt
echo.

REM Backup options.txt
copy options.txt options.bkp /y

REM Read rows versions.txt
for /f %%f in (versions.txt) do (
REM Split : in versions.txt
for /f "tokens=1,2,3 delims=: " %%a in ("%%f") do (
for /f "tokens=1,2,3,4 delims=: " %%a in ("%%f") do (
if exist "options.tmp" (
del options.tmp
)
Expand All @@ -27,28 +31,43 @@ for /f %%f in (versions.txt) do (
REM Split : in options.txt
for /f "tokens=1,2,3 delims=: " %%p in ("%%o") do (
REM Do first part in option and version match?
if %%p == %%a (
if not exist "%libpath%%%c" (
if %%p == %%b (
if not exist "%libpath%%%d" (
REM Update script
if not "%%r" == "" (
wget.exe %server%js/%%c /output %libpath%%%r
wget.exe %server%%%a/%%d /output %libpath%%%r
) else (
wget.exe %server%js/%%c /output %libpath%%%c
wget.exe %server%%%a/%%d /output %libpath%%%d
)
echo %%b %%c has been updated

if "%%a" == "rar" (
"%programfiles%/WinRAR/unrar" x -y "%libpath%%%d" "%libpath%"
echo unpack "%libpath%%%d"
)
echo %%a %%b has been updated
) else (
REM Do second part in option and version NOT match?
REM Update script
if not "%%r" == "" (
wget.exe %server%js/%%c /output %libpath%%%r
if not %%q == %%c (
REM Update script
if not "%%r" == "" (
wget.exe %server%%%a/%%d /output %libpath%%%r
) else (
wget.exe %server%%%a/%%d /output %libpath%%%d
)
echo %%b %%c has been updated

if "%%a" == "rar" (
"%programfiles%/WinRAR/unrar" x -y "%libpath%%%d" "%libpath%"
echo unpack "%libpath%%%d"
)
) else (
wget.exe %server%js/%%c /output %libpath%%%c
echo %%b %%c
)
)
if not "%%r" == "" (
echo %%a:%%b:%%r>> options.tmp
echo %%b:%%c:%%r>> options.tmp
) else (
echo %%a:%%b>> options.tmp
echo %%b:%%c>> options.tmp
)
) else (
echo %%o>> options.tmp
Expand All @@ -61,4 +80,5 @@ for /f %%f in (versions.txt) do (


echo.
endlocal
pause
5 changes: 3 additions & 2 deletions build/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
jquery:1.5.1:jquery-1.5.1.min.js
css3finalize:1.35:jquery.css3finalize-latest.min.js
js:jquery:1.5.1:jquery-1.5.1.min.js
js:css3finalize:1.35:jquery.css3finalize-latest.min.js
rar:kirby:0.4:kirby.rar

0 comments on commit 60d96c9

Please sign in to comment.