Skip to content

Commit

Permalink
Expose new metadata fields to docuploader create-metadata (#8)
Browse files Browse the repository at this point in the history
Change-Id: I59379c6b89b5130095ea5bf0b648b7161ebf6a11
  • Loading branch information
theacodes authored and busunkim96 committed Jun 17, 2019
1 parent e3c10bc commit b5db9e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docuploader/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def upload(
@click.option("--product-page", default="")
@click.option("--github-repository", default="")
@click.option("--issue-tracker", default="")
@click.option("--stem", default="")
@click.option("--serving-path", default="")
@click.argument("destination", default="docs.metadata")
def create_metadata(
name: str,
Expand All @@ -150,6 +152,8 @@ def create_metadata(
github_repository: str,
issue_tracker: str,
destination: str,
stem: str,
serving_path: str,
):
metadata = metadata_pb2.Metadata()
metadata.update_time.FromDatetime(datetime.datetime.utcnow())
Expand All @@ -160,6 +164,8 @@ def create_metadata(
metadata.product_page = product_page
metadata.github_repository = github_repository
metadata.issue_tracker = issue_tracker
metadata.stem = stem
metadata.serving_path = serving_path

destination_path = pathlib.Path(destination)
destination_path.write_text(text_format.MessageToString(metadata))
Expand Down

0 comments on commit b5db9e6

Please sign in to comment.