Skip to content

Commit 6ad2a42

Browse files
authored
Merge pull request #167 from internxt/fix/files-downloaded-with-null-extension
[_]: fix/file-extension-on-download-drive-file-with-null-type
2 parents 1937592 + 6477bb9 commit 6ad2a42

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/commands/download-file.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ export default class DownloadFile extends Command {
166166
};
167167

168168
private getDownloadPath = async (downloadDirectory: string, driveFile: DriveFileItem, overwrite: boolean) => {
169+
const ext = driveFile.type?.length && driveFile.type.length > 0 ? `.${driveFile.type}` : undefined;
169170
const filename = path.format({
170171
name: driveFile.name,
171-
ext: `.${driveFile.type}`,
172+
ext: ext,
172173
});
173174

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

0 commit comments

Comments
 (0)