I am trying to get free disk space in an electron application targeting linux. I have following code to get free space.
const checkDiskSpace = require('check-disk-space').default
checkDiskSpace(path.dirname(__dirname)).then((diskSpace) => {
console.log(diskSpace);
successCallback(diskSpace.free);
}).catch(failCallback);
This one works for .deb but for AppImage and snap package it fails to execute this call. In AppImage, i get the following output.
diskPath: undefined
free: 0
size: 0
Any idea how can i make it work in these environments ?