Skip to content

Instantly share code, notes, and snippets.

@DimitrK
Last active December 17, 2015 17:49
Show Gist options
  • Save DimitrK/5649020 to your computer and use it in GitHub Desktop.
Save DimitrK/5649020 to your computer and use it in GitHub Desktop.
Brackets extension batch updater for Windows. For more info read the readme.md file.

Brackets Extensions Updater

Brackets extension batch update for Windows.


Requirements

To use this updater you need:

  • Windows Pc
  • Git installed
  • Extensions that you used git clone command to get them.

Set up

  1. Download the BracketsExtesionsUpdater.bat file or copy the contents and paste them in a new .bat file.
  2. Copy and paste the .bat file to Brackets 'extensions' folder. The easiest way getting there is from inside Brackets editor by choosing Help -> Show Extensions Folder.
  3. Double click to run it or put it on windows scheduler ( See How to schedule Tasks )

The results will be saved on updatelog.xml which you can then process or view as xml file.

Author: Dimitris Kyriazopoulos

License: MIT License

:: Brackets Extensions Updater
:: Dimitris Kyriazopoulos. jim.feedback at Google mail dot com
:: MIT License. For more info visit http://opensource.org/licenses/MIT
@echo off
call:iterateFolders >> updatelog.xml
echo.&goto:eof
:iterateFolders
set "extensionsDir=%~dp0"
set "ddate=%date:~-4%%date:~4,2%%date:~7,2%"
echo. ^<UPDATE date = ^"%ddate%^"^>
for /F "usebackq" %%D in (`DIR /b %extensionsDir%`) do IF EXIST %%~sD\NUL (
call :updateExtensions %extensionsDir%%%D\ %%D
)
echo. ^<^/UPDATE^>
GOTO:EOF
:updateExtensions
set "currentFolderPath=%~1"
set "currentFolderName=%~2"
pushd %currentFolderPath%
echo. ^<EXTENSIONS kind = ^"%currentFolderName%^"^>
for /f "usebackq" %%G in (`DIR /b %currentFolderPath%`) do IF EXIST %%~sG\NUL (
echo. ^<EXTENSION name = ^"%%G^"^>
pushd %currentFolderPath%%%G
call git pull
popd %currentFolderPath%%%G
echo. ^<^/EXTENSION^>
)
popd %currentFolderPath%
echo. ^<^/EXTENSIONS^>
goto:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment