chore: pr feedbacks
This commit is contained in:
parent
3937c9d4f6
commit
3e805d1223
1 changed files with 30 additions and 29 deletions
|
|
@ -43,6 +43,8 @@ const mount = async (config: BackendConfig, path: string) => {
|
|||
|
||||
const credentialsDir = await fs.mkdtemp(`${os.tmpdir()}/zerobyte-smb-`);
|
||||
const credentialsPath = `${credentialsDir}/credentials`;
|
||||
|
||||
try {
|
||||
const credentialsLines: string[] = [];
|
||||
|
||||
if (config.guest) {
|
||||
|
|
@ -72,7 +74,6 @@ const mount = async (config: BackendConfig, path: string) => {
|
|||
logger.debug(`Mounting SMB volume ${path}...`);
|
||||
logger.info(`Executing mount: mount ${args.join(" ")}`);
|
||||
|
||||
try {
|
||||
try {
|
||||
await executeMount(args);
|
||||
} catch (error) {
|
||||
|
|
@ -81,7 +82,7 @@ const mount = async (config: BackendConfig, path: string) => {
|
|||
}
|
||||
} finally {
|
||||
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.`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue