mirror of
https://github.com/iptv-org/iptv
synced 2026-05-07 10:07:05 -04:00
Update edit.ts
This commit is contained in:
@@ -4,9 +4,10 @@ import { select, input } from '@inquirer/prompts'
|
|||||||
import { Playlist, Stream } from '../../models'
|
import { Playlist, Stream } from '../../models'
|
||||||
import { Storage } from '@freearhey/storage-js'
|
import { Storage } from '@freearhey/storage-js'
|
||||||
import { PlaylistParser } from '../../core'
|
import { PlaylistParser } from '../../core'
|
||||||
|
import { ROOT_DIR } from '../../constants'
|
||||||
|
import { truncate } from '../../utils'
|
||||||
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 { truncate } from '../../utils'
|
|
||||||
import { Command } from 'commander'
|
import { Command } from 'commander'
|
||||||
import readline from 'readline'
|
import readline from 'readline'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
@@ -33,7 +34,7 @@ const filepath = program.args[0]
|
|||||||
const logger = new Logger()
|
const logger = new Logger()
|
||||||
|
|
||||||
const resolvedPath = path.resolve(filepath)
|
const resolvedPath = path.resolve(filepath)
|
||||||
const relative = path.relative(process.cwd(), resolvedPath)
|
const relative = path.relative(ROOT_DIR, resolvedPath)
|
||||||
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
||||||
console.error(`Error: filepath "${filepath}" is outside the working directory`)
|
console.error(`Error: filepath "${filepath}" is outside the working directory`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user