diff --git a/src/vaults/VaultOps.ts b/src/vaults/VaultOps.ts index 1aeee3168..93d735e89 100644 --- a/src/vaults/VaultOps.ts +++ b/src/vaults/VaultOps.ts @@ -173,41 +173,7 @@ async function deleteSecret( * Adds an empty directory to the root of the vault. * i.e. mkdir("folder", { recursive = false }) creates the "/folder" directory */ -async function mkdir( - vault: Vault, - dirPath: string, - fileOptions?: FileOptions, - logger?: Logger, -): Promise { - const recursive = fileOptions?.recursive ?? false; - - await vault.writeF(async (efs) => { - try { - await efs.mkdir(dirPath, fileOptions); - } catch (e) { - if (e.code === 'ENOENT' && !recursive) { - throw new vaultsErrors.ErrorVaultsRecursive( - `could not create directory '${dirPath}' without recursive option`, - { cause: e }, - ); - } - if (e.code === 'EEXIST') { - throw new vaultsErrors.ErrorSecretsSecretDefined( - `${dirPath} already exists`, - { cause: e }, - ); - } - throw e; - } - logger?.info(`Created secret directory at '${dirPath}'`); - }); -} - -/** - * Adds an empty directory to the root of the vault. - * i.e. mkdir("folder", { recursive = false }) creates the "/folder" directory - */ -async function* makeDirectories( +async function* mkdir( vault: Vault, dirPaths: Array, fileOptions?: FileOptions, @@ -328,7 +294,6 @@ export { statSecret, deleteSecret, mkdir, - makeDirectories, addSecretDirectory, listSecrets, writeSecret,