Skip to content

Commit 68f6417

Browse files
fix(update): mkdir install dir before writing binary (closes #97) (#100)
1 parent 4d11c8f commit 68f6417

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.changeset/fix-update-mkdir.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"playground-cli": patch
3+
---
4+
5+
`dot update` now creates its install directory if missing instead of failing with ENOENT. Previously the directory was assumed to exist (created by `install.sh` during `dot init`), causing `dot update` to fail on environments that didn't run the installer (e.g. CI runners spawning the CLI directly). Fixes #97.

src/commands/update.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
chmodSync,
44
closeSync,
55
fsyncSync,
6+
mkdirSync,
67
openSync,
78
renameSync,
89
unlinkSync,
@@ -154,6 +155,7 @@ export const updateCommand = new Command("update")
154155
"install update",
155156
{ "cli.update.asset": asset },
156157
async () => {
158+
mkdirSync(installDir, { recursive: true });
157159
atomicInstall(dest, binary);
158160

159161
if (platform() === "darwin") {

0 commit comments

Comments
 (0)