mirror of
https://github.com/iptv-org/epg
synced 2026-03-21 19:30:52 -04:00
Update edit.ts
This commit is contained in:
@@ -8,7 +8,6 @@ import { Channel } from '../../models'
|
|||||||
import nodeCleanup from 'node-cleanup'
|
import nodeCleanup from 'node-cleanup'
|
||||||
import * as sdk from '@iptv-org/sdk'
|
import * as sdk from '@iptv-org/sdk'
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import readline from 'readline'
|
|
||||||
|
|
||||||
interface ChoiceValue {
|
interface ChoiceValue {
|
||||||
type: string
|
type: string
|
||||||
@@ -21,17 +20,6 @@ interface Choice {
|
|||||||
default?: boolean
|
default?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
|
||||||
readline
|
|
||||||
.createInterface({
|
|
||||||
input: process.stdin,
|
|
||||||
output: process.stdout
|
|
||||||
})
|
|
||||||
.on('SIGINT', function () {
|
|
||||||
process.emit('SIGINT')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
|
|
||||||
program.argument('<filepath>', 'Path to *.channels.xml file to edit').parse(process.argv)
|
program.argument('<filepath>', 'Path to *.channels.xml file to edit').parse(process.argv)
|
||||||
@@ -44,6 +32,7 @@ let channelsFromXML = new Collection<Channel>()
|
|||||||
main(filepath)
|
main(filepath)
|
||||||
nodeCleanup(() => {
|
nodeCleanup(() => {
|
||||||
save(filepath, channelsFromXML)
|
save(filepath, channelsFromXML)
|
||||||
|
if (process.platform === 'win32') process.kill(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
export default async function main(filepath: string) {
|
export default async function main(filepath: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user