refactor data hosting

This commit is contained in:
zeppi 2022-02-18 17:46:55 -05:00 committed by jessopb
parent bf87ac08db
commit e9502410de

22
ui/util/diskspace.js Normal file
View file

@ -0,0 +1,22 @@
const { exec } = require('child_process');
export const diskSpaceLinux = (path) => {
return new Promise((resolve, reject) => {
exec(`df ${path}`, (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return reject();
}
if (stderr) {
return reject();
}
resolve(stdout);
});
});
};
// export diskSpaceWindows = (path) => {
// new Promise((resolve, reject) => {
//
// });
// }