Skip to content

Commit

Permalink
+ add option to get path without directory in local adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
tesirm99 committed May 22, 2024
1 parent a2a1043 commit 35dbd4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AdapterLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ export class AdapterLocal extends AbstractAdapter {
try {
const p = path.join(this._config.directory, bucketName, fileName);
await fs.promises.access(p);
if(options.withoutDirectory) {
return { value: path.join(bucketName, fileName), error: null };
}
return { value: p, error: null };
} catch (e) {
return { value: null, error: e.message };
Expand Down

0 comments on commit 35dbd4d

Please sign in to comment.