Created
March 12, 2014 16:07
-
-
Save Voronenko/9510072 to your computer and use it in GitHub Desktop.
This example copies Vagrantfile and fixes relative path in target file
This file contains 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 | |
setlocal enabledelayedexpansion | |
set INTEXTFILE=.kitchen\kitchen-vagrant\default-precise32-vsdev\Vagrantfile | |
set OUTTEXTFILE=Vagrantfile | |
set SEARCHTEXT=../../../ | |
set REPLACETEXT= | |
set OUTPUTLINE= | |
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do ( | |
SET string=%%A | |
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%! | |
echo !modified! >> %OUTTEXTFILE% | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment