diff options
Diffstat (limited to 'frontend/lib/storage.ts')
| -rw-r--r-- | frontend/lib/storage.ts | 3 |
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 @@ | |||
| 1 | import { exec } from 'child_process' | 1 | import { exec } from 'child_process' |
| 2 | import { promisify } from 'util' | 2 | import { promisify } from 'util' |
| 3 | import { Env_get_required } from './env' | ||
| 3 | 4 | ||
| 4 | const execAsync = promisify(exec) | 5 | const 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 |
