import json
import os
-import yaml
-
-def main():
+def main(update=True):
data = os.path.join(os.path.dirname(__file__), '..', 'data')
deck_dir = os.path.join(data, 'location_decks')
yaml_path = os.path.join(deck_dir, yaml_fn)
json_path = os.path.join(deck_dir, json_fn)
+ if not update and os.path.exists(json_path):
+ continue
+
+ import yaml
with open(yaml_path) as yaml_f:
obj = yaml.safe_load(yaml_f)
with open(json_path, 'w') as json_f: