Added check for basics to sync CLI
This commit is contained in:
parent
6ffd153c9e
commit
7025f028c9
2 changed files with 5 additions and 10 deletions
|
@ -1,6 +1,9 @@
|
||||||
import click
|
import click
|
||||||
|
from project.utils import config, constants
|
||||||
|
|
||||||
@click.command('sync')
|
@click.command('sync')
|
||||||
def cli():
|
def cli():
|
||||||
pass
|
if not config.has_basics():
|
||||||
|
print("You do not have all the basic requirements set.")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,6 @@ def has_repo_cloned():
|
||||||
return os.path.isdir('./data')
|
return os.path.isdir('./data')
|
||||||
|
|
||||||
|
|
||||||
def has_required_config_set():
|
|
||||||
REQUIRED_KEYS = ['public_repo']
|
|
||||||
for key in REQUIRED_KEYS:
|
|
||||||
if not config.get(key):
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def clone_public_data():
|
def clone_public_data():
|
||||||
exit_code = 0
|
exit_code = 0
|
||||||
exit_code = os.system("git clone -b master --single-branch {} data"
|
exit_code = os.system("git clone -b master --single-branch {} data"
|
||||||
|
|
Reference in a new issue