Skip to content

Commit

Permalink
fix: temporary disable disk type check, bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Sep 19, 2024
1 parent 485122c commit 44e5a05
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
"wait-on": "^7.2.0"
},
"dependencies": {
"@filen/network-drive": "^0.9.15",
"@filen/network-drive": "^0.9.16",
"@filen/s3": "^0.2.39",
"@filen/sdk": "^0.1.167",
"@filen/sync": "^0.1.65",
"@filen/sync": "^0.1.66",
"@filen/web": "^0.1.43",
"@filen/webdav": "^0.2.52",
"axios": "^1.7.2",
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ if (IS_ELECTRON) {
console.error(err)

dialog.showErrorBox("Could not launch Filen", err instanceof Error ? err.message : "Unknown error")

setTimeout(() => {
app?.exit(1)
}, 3000)
})
}

Expand Down
16 changes: 11 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ export function parseByteRange(range: string, totalLength: number): { start: num
return null
}

return { start, end }
return {
start,
end
}
}

export type DriveInfo = {
Expand All @@ -238,8 +241,11 @@ export type LinuxDrive = {
children?: LinuxDrive[]
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function getDiskType(filePath: string): Promise<DriveInfo | null> {
const normalizedPath = pathModule.resolve(filePath)
return null // Temporary disabled

/*const normalizedPath = pathModule.resolve(filePath)
if (process.platform === "win32") {
return await getDiskTypeWindows(normalizedPath)
Expand All @@ -249,7 +255,7 @@ export async function getDiskType(filePath: string): Promise<DriveInfo | null> {
return await getDiskTypeLinux(normalizedPath)
} else {
throw new Error(`Unsupported platform: ${process.platform}`)
}
}*/
}

export async function getDiskTypeWindows(filePath: string): Promise<DriveInfo | null> {
Expand Down Expand Up @@ -278,7 +284,7 @@ export async function getDiskTypeWindows(filePath: string): Promise<DriveInfo |
}
}

async function getDiskTypeMacOS(filePath: string): Promise<DriveInfo | null> {
export async function getDiskTypeMacOS(filePath: string): Promise<DriveInfo | null> {
try {
const mountOutput = await execCommand(`df "${filePath}" | tail -1 | awk '{print $1}'`)

Expand Down Expand Up @@ -318,7 +324,7 @@ async function getDiskTypeMacOS(filePath: string): Promise<DriveInfo | null> {
}
}

async function getDiskTypeLinux(filePath: string): Promise<DriveInfo | null> {
export async function getDiskTypeLinux(filePath: string): Promise<DriveInfo | null> {
try {
const stdout = await execCommand("lsblk -o NAME,TYPE,MOUNTPOINT,FSTYPE,MODEL,SERIAL,SIZE,STATE,ROTA --json")
const drives: { blockdevices: LinuxDrive[] } = JSON.parse(stdout)
Expand Down

0 comments on commit 44e5a05

Please sign in to comment.