diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2024-02-12 15:35:42 +0000 |
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2024-02-12 15:35:42 +0000 |
| commit | 95a34e9de9eef195c0b31e513b688a0c3c85e631 (patch) | |
| tree | 4576c66cd857c8c870c5aa032174146012b47129 /make_repo.py | |
| parent | cd055d0580b5ef704a05815183a0444370d58aa0 (diff) | |
| download | git-scripts-95a34e9de9eef195c0b31e513b688a0c3c85e631.tar.gz git-scripts-95a34e9de9eef195c0b31e513b688a0c3c85e631.zip | |
Updated script, switched to cgit
Diffstat (limited to 'make_repo.py')
| -rwxr-xr-x | make_repo.py | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/make_repo.py b/make_repo.py index 0e2c9d1..ddd7f88 100755 --- a/make_repo.py +++ b/make_repo.py @@ -64,16 +64,12 @@ with ChangeCWD(repo_dir): subprocess.run(["ln", "-s", os.path.join(os.path.dirname(conf_path), "post-receive-hook.sh"), os.path.join(repo_dir, "hooks", "post-receive")]) -repo_metadata_path = os.path.join(CONFIG.get("git", "repo_meta_path"), repo_name + ".conf") -repo_metadata = configparser.ConfigParser() -repo_metadata[repo_name] = { - "name": repo_name, - "path": repo_dir, - "visible": not private, - "url": repo_url -} -with open(repo_metadata_path, "w") as f: - repo_metadata.write(f) +if not private: + repo_metadata_path = os.path.join(CONFIG.get("git", "repo_meta_path")) + with open(repo_metadata_path, "a") as f: + f.write("repo.url=%s\n" % repo_name) + f.write("repo.path=%s\n" % repo_dir) + f.write("repo.desc=%s\n\n" % description) if input("Would you like the repository to remain bare? Useful for making mirrors of Github repos. <y/n>: ").lower() != "y": with tempfile.TemporaryDirectory() as tempdir: @@ -119,14 +115,6 @@ if input("Would you like the repository to remain bare? Useful for making mirror subprocess.run(["git", "commit", "-m", "Initialized repository"]) subprocess.run(["git", "push", "origin", "master"]) -# could do this with the docker API instead maybe -proc = subprocess.Popen(CONFIG.get("git", "restart_ui_cmd").split(), stdout = subprocess.PIPE) -while True: - line = proc.stdout.readline() - if not line: - break - print(line.decode()) - print(""" Repository created. You can now clone or add remote: |
