Skip to content

Commit 72105e3

Browse files
committed
Allow the example/load.py script to load other repos from CLI
1 parent 211ee23 commit 72105e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

example/load.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from os.path import dirname, basename, abspath
66
from datetime import datetime
77
import logging
8+
import sys
89

910
import git
1011

@@ -177,7 +178,7 @@ def load_repo(client, path=None, index='git'):
177178
es = Elasticsearch()
178179

179180
# we load the repo and all commits
180-
load_repo(es)
181+
load_repo(es, path=sys.argv[1] if len(sys.argv) == 2 else None)
181182

182183
# run the bulk operations
183184
success, _ = bulk(es, REPO_ACTIONS, index='git', raise_on_error=True)

0 commit comments

Comments
 (0)