Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 49b225a

Browse files
committed
Update the library post build
1 parent 089435c commit 49b225a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/_templates

runestone/__main__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from pkg_resources import resource_string, resource_filename, require
1717
from .pretext.chapter_pop import manifest_data_to_db
1818
import codecs
19+
from runestone.server import get_dburl
20+
from runestone.server.utils import update_library
1921

2022
if len(sys.argv) == 2:
2123
if "--version" in sys.argv:
@@ -199,6 +201,14 @@ def build(all, wd):
199201

200202
paver_main(args=myargs)
201203

204+
# Need a small config object with a dburl attribute just for update_library
205+
config = type("config", (object,), {})()
206+
config.dburl = get_dburl()
207+
course = pavement.options.project_name
208+
if not course:
209+
course = pavement.options.template_args["course_id"]
210+
update_library(config, "", course, click, build_system="Runestone")
211+
202212

203213
@cli.command(short_help="preview the book in a minimal server (NO API support)")
204214
@click.option("--port", default=8000, help="port for server to listen on")

0 commit comments

Comments
 (0)