Skip to content

Commit

Permalink
fix hyperbook.json already present
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebarkmin committed Sep 8, 2024
1 parent 339ae05 commit 617d70a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-readers-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hyperbook": patch
---

Fix hyperbook.json already present, which leads to build errors in docker container.
19 changes: 11 additions & 8 deletions packages/hyperbook/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,19 @@ module.exports = {

const orig = path.join(root, "hyperbook.json");
const temp = path.join(root, ".hyperbook", "hyperbook.json");
console.log(`${chalk.blue(`[${prefix}]`)} Copying hyperbook.json from ${orig} to ${temp}.`);
fs.cpSync(
orig,
temp,
{
force: true,
},
console.log(
`${chalk.blue(`[${prefix}]`)} Copying hyperbook.json from ${orig} to ${temp}.`,
);
fs.rmSync(temp, {
force: true,
});
fs.cpSync(orig, temp, {
force: true,
});

console.log(`${chalk.blue(`[${prefix}]`)} Updating temporarily created hyperbook.json.`);
console.log(
`${chalk.blue(`[${prefix}]`)} Updating temporarily created hyperbook.json.`,
);
fs.writeFileSync(
path.join(root, ".hyperbook", "hyperbook.json"),
JSON.stringify(hyperbookJson, null, 2),
Expand Down

0 comments on commit 617d70a

Please sign in to comment.