Created
September 24, 2014 05:46
-
-
Save 0x4a/67163211602eed8c6ad9 to your computer and use it in GitHub Desktop.
tidy plentymarkets layout sources while preserving cms syntax - #work #regex #batch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF & REM coding:oem; | |
:: Copyright (c) 2014, Daniel Jackel / Samenhaus Müller | |
:: licensed under the BSD-new license (samenhaus.de/layout/license.txt) | |
:: www.samenhaus.de / [email protected] | |
IF [%1] == [] ECHO usage: %0 ^<file^> & exit /b | |
IF NOT EXIST %1 ECHO file not found: %1 & exit /b | |
ECHO hide cms syntax | |
sed -e "s/\([^\x22]\|^\){%% /\1<!--{ %% /g" -e "s/ %%}\([^\x22]\|$\)/ %% }-->\1/g" %1 > %1.$$ && mv %1.$$ %1 | |
rem pause | |
ECHO tidy... | |
tidy.exe -config tidy.cfg %1 | |
rem pause | |
ECHO show cms syntax | |
sed -e "s/\([^\x22]\|^\)<!--{ %% /\1{%% /g" -e "s/ %% }-->\([^\x22]\|$\)/ %%}\1/g" %1 > %1.$$ && mv %1.$$ %1 | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment