mirror of
https://github.com/daylinmorgan/git-server.git
synced 2024-11-14 16:17:53 -06:00
30 lines
593 B
Python
30 lines
593 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
from pathlib import Path
|
||
|
import shutil
|
||
|
|
||
|
GITEA_REPOS = Path(__file__).parent / "gitea/git/repositories/daylin"
|
||
|
SOFT_REPOS = Path(__file__).parent / "soft/repos"
|
||
|
|
||
|
allowed = ["dotfiles", "gitea-server"]
|
||
|
|
||
|
|
||
|
def main():
|
||
|
|
||
|
for repo in GITEA_REPOS.iterdir():
|
||
|
name = repo.name.replace(".git", "")
|
||
|
if name not in allowed:
|
||
|
continue
|
||
|
print(repo)
|
||
|
|
||
|
dest = SOFT_REPOS / name
|
||
|
print(f">> {dest}")
|
||
|
|
||
|
if dest.is_dir():
|
||
|
shutil.rmtree(dest)
|
||
|
shutil.copytree(repo, dest)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|