diff --git a/ui/util/diskspace.js b/ui/util/diskspace.js new file mode 100644 index 000000000..f5f527669 --- /dev/null +++ b/ui/util/diskspace.js @@ -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) => { +// +// }); +// }