mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Another try
This commit is contained in:
parent
0106767c35
commit
2810a87cd0
2 changed files with 10 additions and 13 deletions
|
|
@ -168,7 +168,16 @@ function loadCa() {
|
|||
}
|
||||
|
||||
const { privateKey, certificate } = generateCa();
|
||||
fs.mkdirSync(certFolder, { recursive: true });
|
||||
|
||||
// Ensure directory exists before writing files
|
||||
try {
|
||||
fs.mkdirSync(certFolder, { recursive: true });
|
||||
} catch (error) {
|
||||
// Directory might already exist or there's a permission issue
|
||||
if (/** @type {any} */(error).code !== 'EEXIST') {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Write files and ensure they're flushed to disk
|
||||
const keyFd = fs.openSync(keyPath, 'w');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue