This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
2015-11-27 18:38:33 +00:00
|
|
|
import click
|
2015-12-05 22:14:54 +00:00
|
|
|
from project.utils import config, repos
|
2015-12-04 09:00:13 +00:00
|
|
|
|
2015-11-27 18:38:33 +00:00
|
|
|
|
|
|
|
@click.command('sync')
|
2015-12-06 18:39:41 +00:00
|
|
|
@click.option('--private', default=False)
|
|
|
|
@click.option('--clean', default=False)
|
|
|
|
def cli(private, clean):
|
|
|
|
if clean:
|
|
|
|
print("Cleaning")
|
|
|
|
repos.clean()
|
2015-12-04 08:50:30 +00:00
|
|
|
if not config.has_basics():
|
|
|
|
print("You do not have all the basic requirements set.")
|
|
|
|
return 1
|
2015-12-06 18:39:41 +00:00
|
|
|
error = repos.clone_public_data()
|
|
|
|
if error:
|
|
|
|
return 1
|
|
|
|
if private:
|
2015-12-06 14:20:55 +00:00
|
|
|
if not config.get('private_repo'):
|
|
|
|
print("private repo not set")
|
2015-12-06 16:27:26 +00:00
|
|
|
return 1
|
2015-12-06 18:39:41 +00:00
|
|
|
error = repos.clone_private_data()
|
|
|
|
return int(error)
|