Skip to content

Commit

Permalink
Merge pull request #167 from internxt/fix/files-downloaded-with-null-…
Browse files Browse the repository at this point in the history
…extension

[_]: fix/file-extension-on-download-drive-file-with-null-type
  • Loading branch information
larryrider authored Jan 17, 2025
2 parents 1937592 + 6477bb9 commit 6ad2a42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/download-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ export default class DownloadFile extends Command {
};

private getDownloadPath = async (downloadDirectory: string, driveFile: DriveFileItem, overwrite: boolean) => {
const ext = driveFile.type?.length && driveFile.type.length > 0 ? `.${driveFile.type}` : undefined;
const filename = path.format({
name: driveFile.name,
ext: `.${driveFile.type}`,
ext: ext,
});

const downloadPath = path.join(downloadDirectory, filename);
Expand Down

0 comments on commit 6ad2a42

Please sign in to comment.