mirror of
https://github.com/clockfort/GitHub-Backup.git
synced 2025-03-16 00:00:06 +01:00
Put repositories in backupdir/repositories/${REPO_NAME}/repository in preparation for adding other repository (meta)data.
This commit is contained in:
parent
83ecc23da4
commit
3824d1196b
1 changed files with 5 additions and 3 deletions
|
@ -187,9 +187,11 @@ def process_account(gh, account, args):
|
|||
def process_repo(repo, args):
|
||||
LOGGER.info("Processing repo: %s", repo.full_name)
|
||||
|
||||
dir = args.backupdir + '/' + args.prefix + repo.name + args.suffix
|
||||
config = "%s/%s" % (dir, "config" if args.mirror else ".git/config")
|
||||
dir = os.path.join(args.backupdir, 'repositories', args.prefix + repo.name + args.suffix, 'repository')
|
||||
config = os.path.join(dir, "config" if args.mirror else ".git/config")
|
||||
|
||||
if not os.access(os.path.dirname(dir), os.F_OK):
|
||||
mkdir_p(os.path.dirname(dir))
|
||||
if not os.access(config, os.F_OK):
|
||||
LOGGER.info("Repo doesn't exists, lets clone it")
|
||||
clone_repo(repo, dir, args)
|
||||
|
@ -216,7 +218,7 @@ def clone_repo(repo, dir, args):
|
|||
if args.mirror:
|
||||
git_args.insert(0, '--mirror')
|
||||
|
||||
git("clone", git_args, args.git, args.backupdir)
|
||||
git("clone", git_args, args.git, os.path.dirname(dir))
|
||||
|
||||
|
||||
def update_repo(repo, dir, args):
|
||||
|
|
Loading…
Add table
Reference in a new issue