-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcanticle.js
More file actions
executable file
·38 lines (32 loc) · 1.08 KB
/
Copy pathcanticle.js
File metadata and controls
executable file
·38 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
const UserInterface = require('./lib/user_interface');
const Storage = require('./lib/storage');
const yargs = require('yargs')
.option('playlist', {
alias: 'p',
describe: 'Playlist to load',
type: 'string',
nargs: 1
})
.option('autoplay', {
alias: 'a',
describe: 'Automatically start playback',
type: 'boolean'
})
.help('h')
.alias('h', 'help')
.argv;
var storage = new Storage(yargs);
storage.on('ready', (initialPlaylists) => {
var userInterface = new UserInterface(storage);
storage.on('log', (message) => {
userInterface.screen.log(message);
});
userInterface.on('shutdown', () => {
console.log('Goodbye!');
});
process.on(['exit', 'SIGINT', 'SIGUSR1', 'SIGUSR2', 'uncaughtException'], () => {
userInterface.shutdown();
});
userInterface.processAutoloads();
});