« 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/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/index.js b/index.js
index a345301..ca62f17 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,5 @@
 // omg I am tired of code
 
-const { getPlayer } = require('./players')
-const { getDownloaderFor } = require('./downloaders')
 const { AppElement } = require('./ui')
 const { updatePlaylistFormat } = require('./playlist-utils')
 const ansi = require('./tui-lib/util/ansi')
@@ -10,6 +8,11 @@ const EventEmitter = require('events')
 const Flushable = require('./tui-lib/util/Flushable')
 const Root = require('./tui-lib/ui/Root')
 
+// Hack to get around errors when piping many things to stdout/err
+// (from general-util promisifyProcess)
+process.stdout.setMaxListeners(Infinity)
+process.stderr.setMaxListeners(Infinity)
+
 process.on('unhandledRejection', error => {
   console.error(error.stack)
   process.exit(1)
@@ -55,7 +58,7 @@ async function main() {
     ]
   }
 
-  grouplike = require('./library.json')
+  grouplike = require(process.argv[2] || './library.json')
 
   grouplike = updatePlaylistFormat(grouplike)