Merge branch 'master' into Carlinhos027-patch-2
This commit is contained in:
@@ -5,6 +5,7 @@ import chalk from 'chalk'
|
|||||||
import { transliterate } from 'transliteration'
|
import { transliterate } from 'transliteration'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { DATA_DIR, STREAMS_DIR } from '../../constants'
|
import { DATA_DIR, STREAMS_DIR } from '../../constants'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
program.argument('[filepath]', 'Path to file to validate').parse(process.argv)
|
program.argument('[filepath]', 'Path to file to validate').parse(process.argv)
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ async function main() {
|
|||||||
const log = new Collection()
|
const log = new Collection()
|
||||||
const buffer = new Dictionary()
|
const buffer = new Dictionary()
|
||||||
try {
|
try {
|
||||||
const relativeFilepath = filepath.replace(STREAMS_DIR, '')
|
const relativeFilepath = filepath.replace(path.normalize(STREAMS_DIR), '')
|
||||||
const playlist = await parser.parse(relativeFilepath)
|
const playlist = await parser.parse(relativeFilepath)
|
||||||
playlist.streams.forEach((stream: Stream) => {
|
playlist.streams.forEach((stream: Stream) => {
|
||||||
const channelNotInDatabase =
|
const channelNotInDatabase =
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export class File {
|
|||||||
content: string
|
content: string
|
||||||
|
|
||||||
constructor(filepath: string, content?: string) {
|
constructor(filepath: string, content?: string) {
|
||||||
this.filepath = filepath
|
this.filepath = path.normalize(filepath)
|
||||||
this.content = content || ''
|
this.content = content || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export class Storage {
|
|||||||
rootDir: string
|
rootDir: string
|
||||||
|
|
||||||
constructor(rootDir?: string) {
|
constructor(rootDir?: string) {
|
||||||
this.rootDir = rootDir || './'
|
this.rootDir = path.normalize(rootDir || './')
|
||||||
}
|
}
|
||||||
|
|
||||||
list(pattern: string): Promise<string[]> {
|
list(pattern: string): Promise<string[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user