« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/downloaders.js
diff options
context:
space:
mode:
Diffstat (limited to 'downloaders.js')
-rw-r--r--downloaders.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/downloaders.js b/downloaders.js
index 4c1ce38..e18c8e0 100644
--- a/downloaders.js
+++ b/downloaders.js
@@ -6,6 +6,7 @@ const mkdirp = promisify(require('mkdirp'))
 const fs = require('fs')
 const fetch = require('node-fetch')
 const tempy = require('tempy')
+const os = require('os')
 const path = require('path')
 const sanitize = require('sanitize-filename')
 
@@ -104,8 +105,7 @@ const removeFileProtocol = arg => {
 const downloaders = {
   extension: 'mp3', // Generally target file extension, used by youtube-dl
 
-  // TODO: Cross-platform stuff
-  rootCacheDir: process.env.HOME + '/.mtui/downloads',
+  rootCacheDir: os.homedir() + '/.mtui/downloads',
 
   http: cachify('http',
     arg => {