-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.js
30 lines (30 loc) · 1.07 KB
/
index.js
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
#!/usr/bin/env node
if (process.argv.length == 2) {
// run with no arguments, display help
console.log(
'Multicast is a persistent solution to presenting content across multiple Chromecast devices.'
)
console.log('')
console.log('USAGE: multicast <command> (--flags)')
console.log('')
console.log('Commands:')
console.log(' config run this first to set up Multicast')
console.log(
' start start Multicast as a foreground process'
)
console.log('')
console.log('Flags:')
console.log(' -v, --version print application version')
console.log(
" --serve-only do not run the mDNS server (won't interrupt existing receivers)"
)
} else {
if (process.argv.find(arg => arg == '-v' || arg == '--version')) {
console.log(`Multicast v${require('./package.json').version}`)
console.log('Author: Aaron Ross (@superhawk610)')
process.exit(0)
}
if (process.argv.find(arg => arg == 'config')) require('./app/config.js')
// run configuration
else require('./app/main.js') // start application
}