Update edit.ts

This commit is contained in:
freearhey
2026-03-15 02:27:17 +03:00
parent 95a7730fd4
commit 11cc1c5297

View File

@@ -8,7 +8,6 @@ import { Channel } from '../../models'
import nodeCleanup from 'node-cleanup'
import * as sdk from '@iptv-org/sdk'
import { Command } from 'commander'
import readline from 'readline'
interface ChoiceValue {
type: string
@@ -21,17 +20,6 @@ interface Choice {
default?: boolean
}
if (process.platform === 'win32') {
readline
.createInterface({
input: process.stdin,
output: process.stdout
})
.on('SIGINT', function () {
process.emit('SIGINT')
})
}
const program = new Command()
program.argument('<filepath>', 'Path to *.channels.xml file to edit').parse(process.argv)
@@ -44,6 +32,7 @@ let channelsFromXML = new Collection<Channel>()
main(filepath)
nodeCleanup(() => {
save(filepath, channelsFromXML)
if (process.platform === 'win32') process.kill(0)
})
export default async function main(filepath: string) {