Skip to content

Instantly share code, notes, and snippets.

@ArtskydJ
Last active February 13, 2016 23:15
Show Gist options
  • Save ArtskydJ/8859428676ed688e8fad to your computer and use it in GitHub Desktop.
Save ArtskydJ/8859428676ed688e8fad to your computer and use it in GitHub Desktop.
git pull all repos in a directory
@echo off
FOR /D %%F in ("*") DO @(
cd %~dp0%%F
if exist "package.json" (
david > nul 2>&1 || echo %%F
)
)
@cd %~dp0
@echo off
ls -1 I:\Music > t1
ls -1 C:\Users\Michael\Music > t2
diff t1 t2 | grep "[<>]" | grep -v "t[12]$"
rm t1 t2
pause
@echo off
FOR /D %%F in ("*") DO (
echo %%F
cat %~dp0%%F\\.git\\config | sed s/:\/\/github/:\/\/ArtskydJ\@github/ > %~dp0temp.txt
cat %~dp0temp.txt > %~dp0%%F\\.git\\config
)
del %~dp0temp.txt
@echo off
FOR /D %%F in ("*") DO (
echo %%F
cat %~dp0%%F\\.git\\config | sed s/ArtskydJ\@// | sed s/https:\/\/github.com\//git\@github.com:/ > %~dp0temp.txt
cat %~dp0temp.txt > %~dp0%%F\\.git\\config
)
del %~dp0temp.txt
@echo off
FOR /D %%F in ("*") DO (
cd %~dp0%%F
echo %%F
git pull -q --ff-only
)
cd %~dp0
@echo off
FOR /D %%F in ("*") DO (
cd %~dp0%%F
git config --get remote.origin.url
git config --get remote.upstream.url
)
cd %~dp0
@echo off
FOR /D %%F in ("*") DO (
ls "%~dp0%%F" -1 | grep -E ".(jpg|png)$" | grep -v -E "Folder.jpg|AlbumArt" | wc -l | node -e "process.stdin.on('data',b=>process.exit(Number(b)))" && echo No picture in %%F
)
echo Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment