const os = require('os')
const path = require('path')

module.exports = {getCacheDirectoryPath}

function getCacheDirectoryPath(platform){
    const homeDirectory = os.homedir()
  
    switch(platform){
      case 'win32':
        return path.join(homeDirectory, 'AppData', 'Local')
      case 'darwin':
        return path.join(homeDirectory, 'Library', 'Caches')
      case 'linux':
        return path.join(homeDirectory, '.cache')
      default: 
        throw new Error("OS platform isn't supported")
    }
}