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

Commit 082199d

Browse files
committed
Fix: use confdir from pavement to open conf.py
1 parent e2b5fdf commit 082199d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

runestone/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ def build(all, wd):
162162
version = require("runestone")[0].version
163163
print("Building with Runestone {}".format(version))
164164

165-
with open("conf.py", encoding="utf-8") as cf:
165+
import pavement
166+
confpath = pathlib.Path(pavement.options.get("confdir", "."))
167+
168+
with open(confpath / "conf.py", encoding="utf-8") as cf:
166169
ctext = cf.read()
167170
if not re.search(r"from runestone import.*(setup|script_files)", ctext):
168171
click.echo(
@@ -182,8 +185,6 @@ def build(all, wd):
182185
)
183186
sys.exit(1)
184187

185-
import pavement
186-
187188
if not os.path.exists(pavement.options.build.builddir):
188189
os.makedirs(pavement.options.build.builddir)
189190

0 commit comments

Comments
 (0)