Created
April 18, 2012 15:44
-
-
Save AndreLouisCaron/2414445 to your computer and use it in GitHub Desktop.
git-archive-all for Windows
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 | |
git-ls-all-submodules | zip -@ ../source-code.zip |
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 | |
rem -- Make sure 'submodules.bat' is still resolved correctly after 'pushd'. | |
set Path=%~dp0;%Path% | |
rem -- Launch from the location of this script. | |
set root=%~dp0 | |
call:explore %root:~0,-1% | |
exit /b 0 | |
:explore | |
rem -- List all files in the current repository. | |
for /f "usebackq delims=" %%p in ( | |
`git ls-files --cached --full-name --no-empty-directory` | |
) do ( | |
echo %~1/%%p | |
) | |
rem -- Recurse into sub-modules. | |
for /f "usebackq delims=" %%p in (`submodules`) do ( | |
pushd "%%p" | |
call:explore %%p | |
popd | |
) | |
exit /b 0 |
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 | |
for /f "usebackq delims=" %%p in ( | |
`call git submodule --quiet foreach 'pwd'` | |
) do ( | |
set base=%%p & echo C:/!base:~3! | |
) | |
exit /b 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment