Skip to content

Commit

Permalink
Adds support for publishing a single layer
Browse files Browse the repository at this point in the history
The ability to handle single or multiple layers without scanning an
entire directory still needs some work, but this should at least provide
the basic functionality.
  • Loading branch information
Mike Graves committed May 23, 2018
1 parent cf1c7a9 commit 3a146b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions slingshot/cli.py
Expand Up @@ -122,9 +122,14 @@ def publish(bags, metadata, workspace, datastore, public, secure,
else None
s = Solr(solr, solr_auth)
gs = GeoServer(public=public, secure=secure, auth=gs_auth)
for b in os.listdir(bags):
if os.path.isfile(os.path.join(bags, 'bag-info.txt')):
_bags = [bags]
else:
_bags = [os.path.join(bags, d) for d in os.listdir(bags)]

for b in _bags:
try:
bag = load_bag(os.path.join(bags, b))
bag = load_bag(b)
metadata_path = os.path.join(metadata, bag.name + '.xml')
# Assume the layer is already published if metadata file exists
if os.path.isfile(metadata_path):
Expand Down

0 comments on commit 3a146b5

Please sign in to comment.