diff --git a/scripts/commands/playlist/format.ts b/scripts/commands/playlist/format.ts index 5f587403a0..345789bc28 100644 --- a/scripts/commands/playlist/format.ts +++ b/scripts/commands/playlist/format.ts @@ -5,8 +5,9 @@ import { Stream, Playlist } from '../../models' import { program } from 'commander' import { DataLoaderData } from '../../types/dataLoader' import { DataProcessorData } from '../../types/dataProcessor' +import path from 'node:path' -program.argument('[filepath]', 'Path to file to validate').parse(process.argv) +program.argument('[filepath...]', 'Path to file to format').parse(process.argv) async function main() { const logger = new Logger() @@ -27,7 +28,8 @@ async function main() { feedsGroupedByChannelId, logosGroupedByStreamId }) - const files = program.args.length ? program.args : await streamsStorage.list('**/*.m3u') + let files = program.args.length ? program.args : await streamsStorage.list('**/*.m3u') + files = files.map((filepath: string) => path.basename(filepath)) let streams = await parser.parse(files) logger.info(`found ${streams.count()} streams`) diff --git a/scripts/commands/playlist/test.ts b/scripts/commands/playlist/test.ts index af398acf96..714758f242 100644 --- a/scripts/commands/playlist/test.ts +++ b/scripts/commands/playlist/test.ts @@ -24,7 +24,7 @@ let streams = new Collection() let isLiveUpdateEnabled = true program - .argument('[filepath]', 'Path to file to validate') + .argument('[filepath...]', 'Path to file to test') .option( '-p, --parallel ', 'Batch size of streams to test concurrently', diff --git a/scripts/commands/playlist/validate.ts b/scripts/commands/playlist/validate.ts index 27f6be0c4e..823acec73f 100644 --- a/scripts/commands/playlist/validate.ts +++ b/scripts/commands/playlist/validate.ts @@ -7,7 +7,7 @@ import { BlocklistRecord, Stream } from '../../models' import { program } from 'commander' import chalk from 'chalk' -program.argument('[filepath]', 'Path to file to validate').parse(process.argv) +program.argument('[filepath...]', 'Path to file to validate').parse(process.argv) type LogItem = { type: string