const childProcess = require('child_process')
const command = 'wmic logicaldisk get caption'

module.exports = function () {
  return new Promise((resolve, reject) => {
    childProcess.exec(command, (err, stdout) => {
      if (err) {
        return reject(err)
      }

      const rows = stdout.split(/\r?\n/)
      resolve(rows)
    })
  })
}

const childProcess = require('child_process')
const command = 'wmic logicaldisk get caption'

module.exports = function () {
  return new Promise((resolve, reject) => {
    childProcess.exec(command, (err, stdout) => {
      if (err) {
        return reject(err)
      }

      const rows = stdout.split(/\r?\n/).filter(row => row.trim().endsWith(':'))
      resolve(rows.map(r => r.trim()))
    })
  })
}

Clean up output from wmic
Clean up output from wmic
