mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Fix config storage paths
This commit is contained in:
parent
2d13b29965
commit
0b4204f983
2 changed files with 16 additions and 9 deletions
|
@ -8,7 +8,7 @@ import * as createTorrent from 'create-torrent'
|
|||
import { pseudoRandomBytes } from 'crypto'
|
||||
import { readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs'
|
||||
import * as mkdirp from 'mkdirp'
|
||||
import { join } from 'path'
|
||||
import { isAbsolute, join } from 'path'
|
||||
import * as pem from 'pem'
|
||||
import * as rimraf from 'rimraf'
|
||||
import { URL } from 'url'
|
||||
|
@ -70,6 +70,12 @@ function pageToStartAndCount (page: number, itemsPerPage: number) {
|
|||
return { start, count: itemsPerPage }
|
||||
}
|
||||
|
||||
function buildPath (path: string) {
|
||||
if (isAbsolute(path)) return path
|
||||
|
||||
return join(root(), path)
|
||||
}
|
||||
|
||||
function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {
|
||||
return function promisified (): Promise<A> {
|
||||
return new Promise<A>((resolve: (arg: A) => void, reject: (err: any) => void) => {
|
||||
|
@ -136,6 +142,7 @@ export {
|
|||
pageToStartAndCount,
|
||||
sanitizeUrl,
|
||||
sanitizeHost,
|
||||
buildPath,
|
||||
|
||||
promisify0,
|
||||
promisify1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue