summaryrefslogtreecommitdiff
path: root/frontend/lib/storage.ts
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-08-13 15:54:46 +0100
committerdiogo464 <[email protected]>2025-08-13 15:54:46 +0100
commit1a219f85b0718ab82beb167bc147648305e2bd61 (patch)
tree0589e99f8d70fbebeaeb9357fd5e3126c784f2b4 /frontend/lib/storage.ts
parentd5b6bf46407892f553bbe2fe4319c08ba3de574c (diff)
frontend: require FCTDRIVE_PATH env var
Diffstat (limited to 'frontend/lib/storage.ts')
-rw-r--r--frontend/lib/storage.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend/lib/storage.ts b/frontend/lib/storage.ts
index 57b2429..a1b2949 100644
--- a/frontend/lib/storage.ts
+++ b/frontend/lib/storage.ts
@@ -1,5 +1,6 @@
1import { exec } from 'child_process' 1import { exec } from 'child_process'
2import { promisify } from 'util' 2import { promisify } from 'util'
3import { Env_get_required } from './env'
3 4
4const execAsync = promisify(exec) 5const execAsync = promisify(exec)
5 6
@@ -28,7 +29,7 @@ export async function fetchStorageData(): Promise<StorageData> {
28 const activeDriveUsage = parseInt(driveSize.trim()) || 0 29 const activeDriveUsage = parseInt(driveSize.trim()) || 0
29 30
30 // Get disk usage in bytes 31 // Get disk usage in bytes
31 const fctdrivePath = process.env.FCTDRIVE_PATH || '/home/diogo464/dev/fctdrive' 32 const fctdrivePath = Env_get_required('FCTDRIVE_PATH')
32 const { stdout: dfOutput } = await execAsync(`df -B1 "${fctdrivePath}"`) 33 const { stdout: dfOutput } = await execAsync(`df -B1 "${fctdrivePath}"`)
33 34
34 // Parse df output - second line contains the data 35 // Parse df output - second line contains the data