From a5877baf3461d6607ccbe2755712bd790b62d8db Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 2 Jun 2018 12:33:01 -0300 Subject: Make space pause (if a track is playing) --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'index.js') 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) -- cgit 1.3.0-6-gf8a5