From e9502410deb29a357aa844eeeaef15f0d69a9ea2 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 18 Feb 2022 17:46:55 -0500 Subject: [PATCH] refactor data hosting --- ui/util/diskspace.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ui/util/diskspace.js 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) => { +// +// }); +// }