Skip to content

Commit 8aa7f71

Browse files
committed
fix: ensure hyper directory exists before saving swarm keypair
1 parent c7ae504 commit 8aa7f71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/protocols/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export function loadKeyPair() {
2525

2626
// Save a new keypair to disk
2727
export function saveKeyPair(keyPair) {
28+
// Ensure the hyper directory exists
29+
fs.ensureDirSync(DEFAULT_HYPER_DIR);
30+
2831
fs.writeJsonSync(KEYPAIR_PATH, {
2932
publicKey: keyPair.publicKey.toString("hex"),
3033
secretKey: keyPair.secretKey.toString("hex")

0 commit comments

Comments
 (0)