chore: pr feedbacks

This commit is contained in:
Nicolas Meienberger 2026-01-29 22:47:21 +01:00
parent 3937c9d4f6
commit 3e805d1223

View file

@ -43,6 +43,8 @@ const mount = async (config: BackendConfig, path: string) => {
const credentialsDir = await fs.mkdtemp(`${os.tmpdir()}/zerobyte-smb-`); const credentialsDir = await fs.mkdtemp(`${os.tmpdir()}/zerobyte-smb-`);
const credentialsPath = `${credentialsDir}/credentials`; const credentialsPath = `${credentialsDir}/credentials`;
try {
const credentialsLines: string[] = []; const credentialsLines: string[] = [];
if (config.guest) { if (config.guest) {
@ -72,7 +74,6 @@ const mount = async (config: BackendConfig, path: string) => {
logger.debug(`Mounting SMB volume ${path}...`); logger.debug(`Mounting SMB volume ${path}...`);
logger.info(`Executing mount: mount ${args.join(" ")}`); logger.info(`Executing mount: mount ${args.join(" ")}`);
try {
try { try {
await executeMount(args); await executeMount(args);
} catch (error) { } catch (error) {
@ -81,7 +82,7 @@ const mount = async (config: BackendConfig, path: string) => {
} }
} finally { } finally {
await fs.rm(credentialsPath, { force: true }); await fs.rm(credentialsPath, { force: true });
await fs.rmdir(credentialsDir).catch(() => {}); await fs.rm(credentialsDir, { force: true, recursive: true });
} }
logger.info(`SMB volume at ${path} mounted successfully.`); logger.info(`SMB volume at ${path} mounted successfully.`);