stagithub

WIP: a stagit helper to mirror users github repos
git clone https://0x1A4.1337.cx/code/stagithub.git
Log | Files | Refs | README | LICENSE

commit cdf1c796185b9124d6bb3d547555a5b62ac3a0ba
parent 30f1b355702b525f52317bc2b1f3215b04ded1e4
Author: tx <trqx@goat.si>
Date:   Fri Apr 14 17:21:58 +0200

add --no-sync --no-stagit

fixup! add --no-sync --no-stagit --no-index

Diffstat:
stagithub/main.py | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/stagithub/main.py b/stagithub/main.py @@ -112,17 +112,20 @@ def mirror(args): repos = sorted(repos) for repo in repos: - repo.update() - repo.run_stagit() + if not args.no_sync: + repo.update() + if not args.no_stagit: + repo.run_stagit() # gen index - shutil.copy(args.logo, os.path.join(outputpath, 'logo.png')) - shutil.copy(args.css, os.path.join(outputpath, 'style.css')) - cmd = ['stagit-index'] - for repo in repos: - cmd.append(repo.mirror_path) - with open(os.path.join(outputpath, 'index.html'), 'w') as indexf: - subprocess.call(cmd, stdout=indexf) + if not args.no_index: + shutil.copy(args.logo, os.path.join(outputpath, 'logo.png')) + shutil.copy(args.css, os.path.join(outputpath, 'style.css')) + cmd = ['stagit-index'] + for repo in repos: + cmd.append(repo.mirror_path) + with open(os.path.join(outputpath, 'index.html'), 'w') as indexf: + subprocess.call(cmd, stdout=indexf) def main(): @@ -136,6 +139,9 @@ def main(): parser.add_argument('--css', metavar='PATH', help='path to CSS', type=str, required=True) parser.add_argument('-m', metavar='SIZE', help='max size of starred repos in kb', type=int) parser.add_argument('-F', help='accept forks (can create duplicates with multiple users)', action='store_true') + parser.add_argument('--no-sync', help='no github sync', action='store_true') + parser.add_argument('--no-stagit', help='do not run stagit', action='store_true') + parser.add_argument('--no-index', help='do not run stagit-index', action='store_true') args=parser.parse_args() mirror(args)