Source

dotfiles / repos.Makefile

Full commit
git_repos := $(wildcard */.git)
hg_repos := $(wildcard */.hg)


update: $(hg_repos) $(git_repos)
	@echo "Updating Hg/Git repositories"
	@$(foreach repo, $(hg_repos), cd $(dir $(repo)); hg pull -u; cd ../;)
	@$(foreach repo, $(git_repos), echo Git repo: $(dir $(repo)); cd $(dir $(repo)); git pull; cd ../;)

status:
	@echo "Running status on Hg/Git repositories"
	@$(foreach repo, $(hg_repos), echo Hg repo: $(dir $(repo)); cd $(dir $(repo)); hg status; cd ../;)
	@$(foreach repo, $(git_repos), echo Git repo: $(dir $(repo)); cd $(dir $(repo)); git status; cd ../;)

push:
	@echo "Running push on Hg/Git repositories"
	@$(foreach repo, $(hg_repos), cd $(dir $(repo)); hg push; cd ../;)
	@$(foreach repo, $(git_repos), echo Git repo: $(dir $(repo)); cd $(dir $(repo)); git push; cd ../;)