diff options
29 files changed, 100 insertions, 117 deletions
diff --git a/package.json b/package.json index 635ceaf76..c452a9f52 100644 --- a/package.json +++ b/package.json | |||
@@ -125,7 +125,6 @@ | |||
125 | "redis": "^2.8.0", | 125 | "redis": "^2.8.0", |
126 | "reflect-metadata": "^0.1.10", | 126 | "reflect-metadata": "^0.1.10", |
127 | "request": "^2.81.0", | 127 | "request": "^2.81.0", |
128 | "rimraf": "^2.5.4", | ||
129 | "safe-buffer": "^5.0.1", | 128 | "safe-buffer": "^5.0.1", |
130 | "scripty": "^1.5.0", | 129 | "scripty": "^1.5.0", |
131 | "sequelize": "4.38.0", | 130 | "sequelize": "4.38.0", |
@@ -154,6 +153,7 @@ | |||
154 | "@types/config": "^0.0.34", | 153 | "@types/config": "^0.0.34", |
155 | "@types/express": "^4.0.35", | 154 | "@types/express": "^4.0.35", |
156 | "@types/express-rate-limit": "^2.9.3", | 155 | "@types/express-rate-limit": "^2.9.3", |
156 | "@types/fs-extra": "^5.0.4", | ||
157 | "@types/libxmljs": "^0.18.0", | 157 | "@types/libxmljs": "^0.18.0", |
158 | "@types/lodash": "^4.14.64", | 158 | "@types/lodash": "^4.14.64", |
159 | "@types/magnet-uri": "^5.1.1", | 159 | "@types/magnet-uri": "^5.1.1", |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index bc59da6af..572283868 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import * as prompt from 'prompt' | 1 | import * as prompt from 'prompt' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { readdirPromise, unlinkPromise } from '../server/helpers/core-utils' | ||
4 | import { CONFIG } from '../server/initializers/constants' | 3 | import { CONFIG } from '../server/initializers/constants' |
5 | import { VideoModel } from '../server/models/video/video' | 4 | import { VideoModel } from '../server/models/video/video' |
6 | import { initDatabaseModels } from '../server/initializers' | 5 | import { initDatabaseModels } from '../server/initializers' |
6 | import { remove, readdir } from 'fs-extra' | ||
7 | 7 | ||
8 | run() | 8 | run() |
9 | .then(() => process.exit(0)) | 9 | .then(() => process.exit(0)) |
@@ -39,7 +39,7 @@ async function run () { | |||
39 | console.log('Processing delete...\n') | 39 | console.log('Processing delete...\n') |
40 | 40 | ||
41 | for (const path of toDelete) { | 41 | for (const path of toDelete) { |
42 | await unlinkPromise(path) | 42 | await remove(path) |
43 | } | 43 | } |
44 | 44 | ||
45 | console.log('Done!') | 45 | console.log('Done!') |
@@ -49,7 +49,7 @@ async function run () { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | async function pruneDirectory (directory: string) { | 51 | async function pruneDirectory (directory: string) { |
52 | const files = await readdirPromise(directory) | 52 | const files = await readdir(directory) |
53 | 53 | ||
54 | const toDelete: string[] = [] | 54 | const toDelete: string[] = [] |
55 | for (const file of files) { | 55 | for (const file of files) { |
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index e0539c414..b25f739bb 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -3,13 +3,13 @@ import { omit } from 'lodash' | |||
3 | import { ServerConfig, UserRight } from '../../../shared' | 3 | import { ServerConfig, UserRight } from '../../../shared' |
4 | import { About } from '../../../shared/models/server/about.model' | 4 | import { About } from '../../../shared/models/server/about.model' |
5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' |
6 | import { unlinkPromise, writeFilePromise } from '../../helpers/core-utils' | ||
7 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' | 6 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' |
8 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' | 7 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' |
9 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 8 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
10 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 9 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' |
11 | import { ClientHtml } from '../../lib/client-html' | 10 | import { ClientHtml } from '../../lib/client-html' |
12 | import { auditLoggerFactory, CustomConfigAuditView } from '../../helpers/audit-logger' | 11 | import { auditLoggerFactory, CustomConfigAuditView } from '../../helpers/audit-logger' |
12 | import { remove, writeJSON } from 'fs-extra' | ||
13 | 13 | ||
14 | const packageJSON = require('../../../../package.json') | 14 | const packageJSON = require('../../../../package.json') |
15 | const configRouter = express.Router() | 15 | const configRouter = express.Router() |
@@ -130,7 +130,7 @@ async function getCustomConfig (req: express.Request, res: express.Response, nex | |||
130 | } | 130 | } |
131 | 131 | ||
132 | async function deleteCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 132 | async function deleteCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) { |
133 | await unlinkPromise(CONFIG.CUSTOM_FILE) | 133 | await remove(CONFIG.CUSTOM_FILE) |
134 | 134 | ||
135 | auditLogger.delete( | 135 | auditLogger.delete( |
136 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | 136 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), |
@@ -163,7 +163,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response, | |||
163 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription | 163 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription |
164 | toUpdateJSON.instance['default_nsfw_policy'] = toUpdate.instance.defaultNSFWPolicy | 164 | toUpdateJSON.instance['default_nsfw_policy'] = toUpdate.instance.defaultNSFWPolicy |
165 | 165 | ||
166 | await writeFilePromise(CONFIG.CUSTOM_FILE, JSON.stringify(toUpdateJSON, undefined, 2)) | 166 | await writeJSON(CONFIG.CUSTOM_FILE, toUpdateJSON, { spaces: 2 }) |
167 | 167 | ||
168 | reloadConfig() | 168 | reloadConfig() |
169 | ClientHtml.invalidCache() | 169 | ClientHtml.invalidCache() |
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index b2f73fa48..44f15ef74 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -27,8 +27,8 @@ import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model' | |||
27 | import { VideoChannelModel } from '../../../models/video/video-channel' | 27 | import { VideoChannelModel } from '../../../models/video/video-channel' |
28 | import * as Bluebird from 'bluebird' | 28 | import * as Bluebird from 'bluebird' |
29 | import * as parseTorrent from 'parse-torrent' | 29 | import * as parseTorrent from 'parse-torrent' |
30 | import { readFileBufferPromise, renamePromise } from '../../../helpers/core-utils' | ||
31 | import { getSecureTorrentName } from '../../../helpers/utils' | 30 | import { getSecureTorrentName } from '../../../helpers/utils' |
31 | import { readFile, rename } from 'fs-extra' | ||
32 | 32 | ||
33 | const auditLogger = auditLoggerFactory('video-imports') | 33 | const auditLogger = auditLoggerFactory('video-imports') |
34 | const videoImportsRouter = express.Router() | 34 | const videoImportsRouter = express.Router() |
@@ -78,10 +78,10 @@ async function addTorrentImport (req: express.Request, res: express.Response, to | |||
78 | 78 | ||
79 | // Rename the torrent to a secured name | 79 | // Rename the torrent to a secured name |
80 | const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, getSecureTorrentName(torrentName)) | 80 | const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, getSecureTorrentName(torrentName)) |
81 | await renamePromise(torrentfile.path, newTorrentPath) | 81 | await rename(torrentfile.path, newTorrentPath) |
82 | torrentfile.path = newTorrentPath | 82 | torrentfile.path = newTorrentPath |
83 | 83 | ||
84 | const buf = await readFileBufferPromise(torrentfile.path) | 84 | const buf = await readFile(torrentfile.path) |
85 | const parsedTorrent = parseTorrent(buf) | 85 | const parsedTorrent = parseTorrent(buf) |
86 | 86 | ||
87 | videoName = isArray(parsedTorrent.name) ? parsedTorrent.name[ 0 ] : parsedTorrent.name as string | 87 | videoName = isArray(parsedTorrent.name) ? parsedTorrent.name[ 0 ] : parsedTorrent.name as string |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index e973aa43f..a86cf4f99 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { extname, join } from 'path' | 2 | import { extname, join } from 'path' |
3 | import { VideoCreate, VideoPrivacy, VideoState, VideoUpdate } from '../../../../shared' | 3 | import { VideoCreate, VideoPrivacy, VideoState, VideoUpdate } from '../../../../shared' |
4 | import { renamePromise } from '../../../helpers/core-utils' | ||
5 | import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | 4 | import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' |
6 | import { processImage } from '../../../helpers/image-utils' | 5 | import { processImage } from '../../../helpers/image-utils' |
7 | import { logger } from '../../../helpers/logger' | 6 | import { logger } from '../../../helpers/logger' |
@@ -56,6 +55,7 @@ import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-u | |||
56 | import { videoCaptionsRouter } from './captions' | 55 | import { videoCaptionsRouter } from './captions' |
57 | import { videoImportsRouter } from './import' | 56 | import { videoImportsRouter } from './import' |
58 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | 57 | import { resetSequelizeInstance } from '../../../helpers/database-utils' |
58 | import { rename } from 'fs-extra' | ||
59 | 59 | ||
60 | const auditLogger = auditLoggerFactory('videos') | 60 | const auditLogger = auditLoggerFactory('videos') |
61 | const videosRouter = express.Router() | 61 | const videosRouter = express.Router() |
@@ -194,7 +194,7 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
194 | // Move physical file | 194 | // Move physical file |
195 | const videoDir = CONFIG.STORAGE.VIDEOS_DIR | 195 | const videoDir = CONFIG.STORAGE.VIDEOS_DIR |
196 | const destination = join(videoDir, video.getVideoFilename(videoFile)) | 196 | const destination = join(videoDir, video.getVideoFilename(videoFile)) |
197 | await renamePromise(videoPhysicalFile.path, destination) | 197 | await rename(videoPhysicalFile.path, destination) |
198 | // This is important in case if there is another attempt in the retry process | 198 | // This is important in case if there is another attempt in the retry process |
199 | videoPhysicalFile.filename = video.getVideoFilename(videoFile) | 199 | videoPhysicalFile.filename = video.getVideoFilename(videoFile) |
200 | videoPhysicalFile.path = destination | 200 | videoPhysicalFile.path = destination |
diff --git a/server/helpers/captions-utils.ts b/server/helpers/captions-utils.ts index 20c9fe5aa..660dce65c 100644 --- a/server/helpers/captions-utils.ts +++ b/server/helpers/captions-utils.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { renamePromise, unlinkPromise } from './core-utils' | ||
2 | import { join } from 'path' | 1 | import { join } from 'path' |
3 | import { CONFIG } from '../initializers' | 2 | import { CONFIG } from '../initializers' |
4 | import { VideoCaptionModel } from '../models/video/video-caption' | 3 | import { VideoCaptionModel } from '../models/video/video-caption' |
5 | import * as srt2vtt from 'srt-to-vtt' | 4 | import * as srt2vtt from 'srt-to-vtt' |
6 | import { createReadStream, createWriteStream } from 'fs-extra' | 5 | import { createReadStream, createWriteStream, remove, rename } from 'fs-extra' |
7 | 6 | ||
8 | async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: VideoCaptionModel) { | 7 | async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: VideoCaptionModel) { |
9 | const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR | 8 | const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR |
@@ -12,9 +11,9 @@ async function moveAndProcessCaptionFile (physicalFile: { filename: string, path | |||
12 | // Convert this srt file to vtt | 11 | // Convert this srt file to vtt |
13 | if (physicalFile.path.endsWith('.srt')) { | 12 | if (physicalFile.path.endsWith('.srt')) { |
14 | await convertSrtToVtt(physicalFile.path, destination) | 13 | await convertSrtToVtt(physicalFile.path, destination) |
15 | await unlinkPromise(physicalFile.path) | 14 | await remove(physicalFile.path) |
16 | } else { // Just move the vtt file | 15 | } else { // Just move the vtt file |
17 | await renamePromise(physicalFile.path, destination) | 16 | await rename(physicalFile.path, destination) |
18 | } | 17 | } |
19 | 18 | ||
20 | // This is important in case if there is another attempt in the retry process | 19 | // This is important in case if there is another attempt in the retry process |
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index 9830d41a8..f5ef187fe 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -6,7 +6,6 @@ | |||
6 | import * as bcrypt from 'bcrypt' | 6 | import * as bcrypt from 'bcrypt' |
7 | import * as createTorrent from 'create-torrent' | 7 | import * as createTorrent from 'create-torrent' |
8 | import { createHash, pseudoRandomBytes } from 'crypto' | 8 | import { createHash, pseudoRandomBytes } from 'crypto' |
9 | import { copyFile, readdir, readFile, rename, stat, Stats, unlink, writeFile, mkdirp } from 'fs-extra' | ||
10 | import { isAbsolute, join } from 'path' | 9 | import { isAbsolute, join } from 'path' |
11 | import * as pem from 'pem' | 10 | import * as pem from 'pem' |
12 | import * as rimraf from 'rimraf' | 11 | import * as rimraf from 'rimraf' |
@@ -168,14 +167,6 @@ function promisify2WithVoid<T, U> (func: (arg1: T, arg2: U, cb: (err: any) => vo | |||
168 | } | 167 | } |
169 | } | 168 | } |
170 | 169 | ||
171 | const copyFilePromise = promisify2WithVoid<string, string>(copyFile) | ||
172 | const readFileBufferPromise = promisify1<string, Buffer>(readFile) | ||
173 | const unlinkPromise = promisify1WithVoid<string>(unlink) | ||
174 | const renamePromise = promisify2WithVoid<string, string>(rename) | ||
175 | const writeFilePromise = promisify2WithVoid<string, any>(writeFile) | ||
176 | const readdirPromise = promisify1<string, string[]>(readdir) | ||
177 | const mkdirpPromise = promisify1<string, string>(mkdirp) | ||
178 | // we cannot modify the Promise types, so we should make the promisify instance check mkdirp | ||
179 | const pseudoRandomBytesPromise = promisify1<number, Buffer>(pseudoRandomBytes) | 170 | const pseudoRandomBytesPromise = promisify1<number, Buffer>(pseudoRandomBytes) |
180 | const createPrivateKey = promisify1<number, { key: string }>(pem.createPrivateKey) | 171 | const createPrivateKey = promisify1<number, { key: string }>(pem.createPrivateKey) |
181 | const getPublicKey = promisify1<string, { publicKey: string }>(pem.getPublicKey) | 172 | const getPublicKey = promisify1<string, { publicKey: string }>(pem.getPublicKey) |
@@ -183,8 +174,6 @@ const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare) | |||
183 | const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt) | 174 | const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt) |
184 | const bcryptHashPromise = promisify2<any, string | number, string>(bcrypt.hash) | 175 | const bcryptHashPromise = promisify2<any, string | number, string>(bcrypt.hash) |
185 | const createTorrentPromise = promisify2<string, any, any>(createTorrent) | 176 | const createTorrentPromise = promisify2<string, any, any>(createTorrent) |
186 | const rimrafPromise = promisify1WithVoid<string>(rimraf) | ||
187 | const statPromise = promisify1<string, Stats>(stat) | ||
188 | 177 | ||
189 | // --------------------------------------------------------------------------- | 178 | // --------------------------------------------------------------------------- |
190 | 179 | ||
@@ -202,20 +191,11 @@ export { | |||
202 | promisify0, | 191 | promisify0, |
203 | promisify1, | 192 | promisify1, |
204 | 193 | ||
205 | copyFilePromise, | ||
206 | readdirPromise, | ||
207 | readFileBufferPromise, | ||
208 | unlinkPromise, | ||
209 | renamePromise, | ||
210 | writeFilePromise, | ||
211 | mkdirpPromise, | ||
212 | pseudoRandomBytesPromise, | 194 | pseudoRandomBytesPromise, |
213 | createPrivateKey, | 195 | createPrivateKey, |
214 | getPublicKey, | 196 | getPublicKey, |
215 | bcryptComparePromise, | 197 | bcryptComparePromise, |
216 | bcryptGenSaltPromise, | 198 | bcryptGenSaltPromise, |
217 | bcryptHashPromise, | 199 | bcryptHashPromise, |
218 | createTorrentPromise, | 200 | createTorrentPromise |
219 | rimrafPromise, | ||
220 | statPromise | ||
221 | } | 201 | } |
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 8936005e0..7c45f3632 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import * as ffmpeg from 'fluent-ffmpeg' | 1 | import * as ffmpeg from 'fluent-ffmpeg' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { VideoResolution } from '../../shared/models/videos' | 3 | import { VideoResolution } from '../../shared/models/videos' |
4 | import { CONFIG, VIDEO_TRANSCODING_FPS, FFMPEG_NICE } from '../initializers' | 4 | import { CONFIG, FFMPEG_NICE, VIDEO_TRANSCODING_FPS } from '../initializers' |
5 | import { unlinkPromise } from './core-utils' | ||
6 | import { processImage } from './image-utils' | 5 | import { processImage } from './image-utils' |
7 | import { logger } from './logger' | 6 | import { logger } from './logger' |
8 | import { checkFFmpegEncoders } from '../initializers/checker' | 7 | import { checkFFmpegEncoders } from '../initializers/checker' |
8 | import { remove } from 'fs-extra' | ||
9 | 9 | ||
10 | function computeResolutionsToTranscode (videoFileHeight: number) { | 10 | function computeResolutionsToTranscode (videoFileHeight: number) { |
11 | const resolutionsEnabled: number[] = [] | 11 | const resolutionsEnabled: number[] = [] |
@@ -90,7 +90,7 @@ async function generateImageFromVideoFile (fromPath: string, folder: string, ima | |||
90 | logger.error('Cannot generate image from video %s.', fromPath, { err }) | 90 | logger.error('Cannot generate image from video %s.', fromPath, { err }) |
91 | 91 | ||
92 | try { | 92 | try { |
93 | await unlinkPromise(pendingImagePath) | 93 | await remove(pendingImagePath) |
94 | } catch (err) { | 94 | } catch (err) { |
95 | logger.debug('Cannot remove pending image path after generation error.', { err }) | 95 | logger.debug('Cannot remove pending image path after generation error.', { err }) |
96 | } | 96 | } |
diff --git a/server/helpers/image-utils.ts b/server/helpers/image-utils.ts index 0065f4210..3eaa674ed 100644 --- a/server/helpers/image-utils.ts +++ b/server/helpers/image-utils.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as sharp from 'sharp' | 2 | import * as sharp from 'sharp' |
3 | import { unlinkPromise } from './core-utils' | 3 | import { remove } from 'fs-extra' |
4 | 4 | ||
5 | async function processImage ( | 5 | async function processImage ( |
6 | physicalFile: { path: string }, | 6 | physicalFile: { path: string }, |
@@ -11,7 +11,7 @@ async function processImage ( | |||
11 | .resize(newSize.width, newSize.height) | 11 | .resize(newSize.width, newSize.height) |
12 | .toFile(destination) | 12 | .toFile(destination) |
13 | 13 | ||
14 | await unlinkPromise(physicalFile.path) | 14 | await remove(physicalFile.path) |
15 | } | 15 | } |
16 | 16 | ||
17 | // --------------------------------------------------------------------------- | 17 | // --------------------------------------------------------------------------- |
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts index 703e57887..a1ed8e72d 100644 --- a/server/helpers/utils.ts +++ b/server/helpers/utils.ts | |||
@@ -2,13 +2,14 @@ import { ResultList } from '../../shared' | |||
2 | import { CONFIG } from '../initializers' | 2 | import { CONFIG } from '../initializers' |
3 | import { ActorModel } from '../models/activitypub/actor' | 3 | import { ActorModel } from '../models/activitypub/actor' |
4 | import { ApplicationModel } from '../models/application/application' | 4 | import { ApplicationModel } from '../models/application/application' |
5 | import { pseudoRandomBytesPromise, sha256, unlinkPromise } from './core-utils' | 5 | import { pseudoRandomBytesPromise, sha256 } from './core-utils' |
6 | import { logger } from './logger' | 6 | import { logger } from './logger' |
7 | import { join } from 'path' | 7 | import { join } from 'path' |
8 | import { Instance as ParseTorrent } from 'parse-torrent' | 8 | import { Instance as ParseTorrent } from 'parse-torrent' |
9 | import { remove } from 'fs-extra' | ||
9 | 10 | ||
10 | function deleteFileAsync (path: string) { | 11 | function deleteFileAsync (path: string) { |
11 | unlinkPromise(path) | 12 | remove(path) |
12 | .catch(err => logger.error('Cannot delete the file %s asynchronously.', path, { err })) | 13 | .catch(err => logger.error('Cannot delete the file %s asynchronously.', path, { err })) |
13 | } | 14 | } |
14 | 15 | ||
diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index 1c0d00d70..1c0cc7058 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { logger } from './logger' | 1 | import { logger } from './logger' |
2 | import { generateVideoTmpPath } from './utils' | 2 | import { generateVideoTmpPath } from './utils' |
3 | import * as WebTorrent from 'webtorrent' | 3 | import * as WebTorrent from 'webtorrent' |
4 | import { createWriteStream } from 'fs-extra' | 4 | import { createWriteStream, remove } from 'fs-extra' |
5 | import { CONFIG } from '../initializers' | 5 | import { CONFIG } from '../initializers' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { unlinkPromise } from './core-utils' | ||
8 | 7 | ||
9 | function downloadWebTorrentVideo (target: { magnetUri: string, torrentName: string }) { | 8 | function downloadWebTorrentVideo (target: { magnetUri: string, torrentName: string }) { |
10 | const id = target.magnetUri || target.torrentName | 9 | const id = target.magnetUri || target.torrentName |
@@ -29,11 +28,11 @@ function downloadWebTorrentVideo (target: { magnetUri: string, torrentName: stri | |||
29 | if (err) return rej(err) | 28 | if (err) return rej(err) |
30 | 29 | ||
31 | if (target.torrentName) { | 30 | if (target.torrentName) { |
32 | unlinkPromise(torrentId) | 31 | remove(torrentId) |
33 | .catch(err => logger.error('Cannot remove torrent %s in webtorrent download.', torrentId, { err })) | 32 | .catch(err => logger.error('Cannot remove torrent %s in webtorrent download.', torrentId, { err })) |
34 | } | 33 | } |
35 | 34 | ||
36 | unlinkPromise(join(CONFIG.STORAGE.VIDEOS_DIR, file.name)) | 35 | remove(join(CONFIG.STORAGE.VIDEOS_DIR, file.name)) |
37 | .catch(err => logger.error('Cannot remove torrent file %s in webtorrent download.', file.name, { err })) | 36 | .catch(err => logger.error('Cannot remove torrent file %s in webtorrent download.', file.name, { err })) |
38 | 37 | ||
39 | res(path) | 38 | res(path) |
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 1926c40dd..e319164e4 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import * as passwordGenerator from 'password-generator' | 1 | import * as passwordGenerator from 'password-generator' |
2 | import { UserRole } from '../../shared' | 2 | import { UserRole } from '../../shared' |
3 | import { mkdirpPromise, rimrafPromise } from '../helpers/core-utils' | ||
4 | import { logger } from '../helpers/logger' | 3 | import { logger } from '../helpers/logger' |
5 | import { createApplicationActor, createUserAccountAndChannel } from '../lib/user' | 4 | import { createApplicationActor, createUserAccountAndChannel } from '../lib/user' |
6 | import { UserModel } from '../models/account/user' | 5 | import { UserModel } from '../models/account/user' |
@@ -9,6 +8,7 @@ import { OAuthClientModel } from '../models/oauth/oauth-client' | |||
9 | import { applicationExist, clientsExist, usersExist } from './checker' | 8 | import { applicationExist, clientsExist, usersExist } from './checker' |
10 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' | 9 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' |
11 | import { sequelizeTypescript } from './database' | 10 | import { sequelizeTypescript } from './database' |
11 | import { remove, ensureDir } from 'fs-extra' | ||
12 | 12 | ||
13 | async function installApplication () { | 13 | async function installApplication () { |
14 | try { | 14 | try { |
@@ -41,7 +41,7 @@ function removeCacheDirectories () { | |||
41 | // Cache directories | 41 | // Cache directories |
42 | for (const key of Object.keys(cacheDirectories)) { | 42 | for (const key of Object.keys(cacheDirectories)) { |
43 | const dir = cacheDirectories[key] | 43 | const dir = cacheDirectories[key] |
44 | tasks.push(rimrafPromise(dir)) | 44 | tasks.push(remove(dir)) |
45 | } | 45 | } |
46 | 46 | ||
47 | return Promise.all(tasks) | 47 | return Promise.all(tasks) |
@@ -52,16 +52,16 @@ function createDirectoriesIfNotExist () { | |||
52 | const cacheDirectories = Object.keys(CACHE) | 52 | const cacheDirectories = Object.keys(CACHE) |
53 | .map(k => CACHE[k].DIRECTORY) | 53 | .map(k => CACHE[k].DIRECTORY) |
54 | 54 | ||
55 | const tasks: Promise<string>[] = [] | 55 | const tasks: Promise<void>[] = [] |
56 | for (const key of Object.keys(storage)) { | 56 | for (const key of Object.keys(storage)) { |
57 | const dir = storage[key] | 57 | const dir = storage[key] |
58 | tasks.push(mkdirpPromise(dir)) | 58 | tasks.push(ensureDir(dir)) |
59 | } | 59 | } |
60 | 60 | ||
61 | // Cache directories | 61 | // Cache directories |
62 | for (const key of Object.keys(cacheDirectories)) { | 62 | for (const key of Object.keys(cacheDirectories)) { |
63 | const dir = cacheDirectories[key] | 63 | const dir = cacheDirectories[key] |
64 | tasks.push(mkdirpPromise(dir)) | 64 | tasks.push(ensureDir(dir)) |
65 | } | 65 | } |
66 | 66 | ||
67 | return Promise.all(tasks) | 67 | return Promise.all(tasks) |
diff --git a/server/initializers/migrations/0075-video-resolutions.ts b/server/initializers/migrations/0075-video-resolutions.ts index 54ea852b1..26a188e5e 100644 --- a/server/initializers/migrations/0075-video-resolutions.ts +++ b/server/initializers/migrations/0075-video-resolutions.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | |||
4 | import { readdirPromise, renamePromise } from '../../helpers/core-utils' | ||
5 | import { CONFIG } from '../../initializers/constants' | 3 | import { CONFIG } from '../../initializers/constants' |
6 | import { getVideoFileResolution } from '../../helpers/ffmpeg-utils' | 4 | import { getVideoFileResolution } from '../../helpers/ffmpeg-utils' |
5 | import { readdir, rename } from 'fs-extra' | ||
7 | 6 | ||
8 | function up (utils: { | 7 | function up (utils: { |
9 | transaction: Sequelize.Transaction, | 8 | transaction: Sequelize.Transaction, |
@@ -14,7 +13,7 @@ function up (utils: { | |||
14 | const torrentDir = CONFIG.STORAGE.TORRENTS_DIR | 13 | const torrentDir = CONFIG.STORAGE.TORRENTS_DIR |
15 | const videoFileDir = CONFIG.STORAGE.VIDEOS_DIR | 14 | const videoFileDir = CONFIG.STORAGE.VIDEOS_DIR |
16 | 15 | ||
17 | return readdirPromise(videoFileDir) | 16 | return readdir(videoFileDir) |
18 | .then(videoFiles => { | 17 | .then(videoFiles => { |
19 | const tasks: Promise<any>[] = [] | 18 | const tasks: Promise<any>[] = [] |
20 | for (const videoFile of videoFiles) { | 19 | for (const videoFile of videoFiles) { |
@@ -31,11 +30,11 @@ function up (utils: { | |||
31 | .then(height => { | 30 | .then(height => { |
32 | const oldTorrentName = uuid + '.torrent' | 31 | const oldTorrentName = uuid + '.torrent' |
33 | const newTorrentName = uuid + '-' + height + '.torrent' | 32 | const newTorrentName = uuid + '-' + height + '.torrent' |
34 | return renamePromise(join(torrentDir, oldTorrentName), join(torrentDir, newTorrentName)).then(() => height) | 33 | return rename(join(torrentDir, oldTorrentName), join(torrentDir, newTorrentName)).then(() => height) |
35 | }) | 34 | }) |
36 | .then(height => { | 35 | .then(height => { |
37 | const newVideoFileName = uuid + '-' + height + '.' + ext | 36 | const newVideoFileName = uuid + '-' + height + '.' + ext |
38 | return renamePromise(join(videoFileDir, videoFile), join(videoFileDir, newVideoFileName)).then(() => height) | 37 | return rename(join(videoFileDir, videoFile), join(videoFileDir, newVideoFileName)).then(() => height) |
39 | }) | 38 | }) |
40 | .then(height => { | 39 | .then(height => { |
41 | const query = 'UPDATE "VideoFiles" SET "resolution" = ' + height + | 40 | const query = 'UPDATE "VideoFiles" SET "resolution" = ' + height + |
diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts index 539e2bc8f..adc2f9fb3 100644 --- a/server/initializers/migrator.ts +++ b/server/initializers/migrator.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import * as path from 'path' | 1 | import * as path from 'path' |
2 | import { readdirPromise } from '../helpers/core-utils' | ||
3 | import { logger } from '../helpers/logger' | 2 | import { logger } from '../helpers/logger' |
4 | import { LAST_MIGRATION_VERSION } from './constants' | 3 | import { LAST_MIGRATION_VERSION } from './constants' |
5 | import { sequelizeTypescript } from './database' | 4 | import { sequelizeTypescript } from './database' |
5 | import { readdir } from 'fs-extra' | ||
6 | 6 | ||
7 | async function migrate () { | 7 | async function migrate () { |
8 | const tables = await sequelizeTypescript.getQueryInterface().showAllTables() | 8 | const tables = await sequelizeTypescript.getQueryInterface().showAllTables() |
@@ -52,7 +52,7 @@ export { | |||
52 | // --------------------------------------------------------------------------- | 52 | // --------------------------------------------------------------------------- |
53 | 53 | ||
54 | async function getMigrationScripts () { | 54 | async function getMigrationScripts () { |
55 | const files = await readdirPromise(path.join(__dirname, 'migrations')) | 55 | const files = await readdir(path.join(__dirname, 'migrations')) |
56 | const filesToMigrate: { | 56 | const filesToMigrate: { |
57 | version: string, | 57 | version: string, |
58 | script: string | 58 | script: string |
diff --git a/server/lib/cache/abstract-video-static-file-cache.ts b/server/lib/cache/abstract-video-static-file-cache.ts index 3e20c5d2a..7512f2b9d 100644 --- a/server/lib/cache/abstract-video-static-file-cache.ts +++ b/server/lib/cache/abstract-video-static-file-cache.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import * as AsyncLRU from 'async-lru' | 1 | import * as AsyncLRU from 'async-lru' |
2 | import { createWriteStream } from 'fs-extra' | 2 | import { createWriteStream, remove } from 'fs-extra' |
3 | import { unlinkPromise } from '../../helpers/core-utils' | ||
4 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
5 | import { VideoModel } from '../../models/video/video' | 4 | import { VideoModel } from '../../models/video/video' |
6 | import { fetchRemoteVideoStaticFile } from '../activitypub' | 5 | import { fetchRemoteVideoStaticFile } from '../activitypub' |
@@ -26,7 +25,7 @@ export abstract class AbstractVideoStaticFileCache <T> { | |||
26 | }) | 25 | }) |
27 | 26 | ||
28 | this.lru.on('evict', (obj: { key: string, value: string }) => { | 27 | this.lru.on('evict', (obj: { key: string, value: string }) => { |
29 | unlinkPromise(obj.value) | 28 | remove(obj.value) |
30 | .then(() => logger.debug('%s evicted from %s', obj.value, this.constructor.name)) | 29 | .then(() => logger.debug('%s evicted from %s', obj.value, this.constructor.name)) |
31 | }) | 30 | }) |
32 | } | 31 | } |
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 72984e778..a69e09c32 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -1,12 +1,13 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as Bluebird from 'bluebird' | 2 | import * as Bluebird from 'bluebird' |
3 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/models/i18n/i18n' | 3 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/models/i18n/i18n' |
4 | import { CONFIG, EMBED_SIZE, CUSTOM_HTML_TAG_COMMENTS, STATIC_PATHS } from '../initializers' | 4 | import { CONFIG, CUSTOM_HTML_TAG_COMMENTS, EMBED_SIZE, STATIC_PATHS } from '../initializers' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { escapeHTML, readFileBufferPromise } from '../helpers/core-utils' | 6 | import { escapeHTML } from '../helpers/core-utils' |
7 | import { VideoModel } from '../models/video/video' | 7 | import { VideoModel } from '../models/video/video' |
8 | import * as validator from 'validator' | 8 | import * as validator from 'validator' |
9 | import { VideoPrivacy } from '../../shared/models/videos' | 9 | import { VideoPrivacy } from '../../shared/models/videos' |
10 | import { readFile } from 'fs-extra' | ||
10 | 11 | ||
11 | export class ClientHtml { | 12 | export class ClientHtml { |
12 | 13 | ||
@@ -20,7 +21,7 @@ export class ClientHtml { | |||
20 | const path = ClientHtml.getIndexPath(req, res, paramLang) | 21 | const path = ClientHtml.getIndexPath(req, res, paramLang) |
21 | if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] | 22 | if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] |
22 | 23 | ||
23 | const buffer = await readFileBufferPromise(path) | 24 | const buffer = await readFile(path) |
24 | 25 | ||
25 | let html = buffer.toString() | 26 | let html = buffer.toString() |
26 | 27 | ||
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index d6984ef92..ebcb2090c 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -6,7 +6,6 @@ import { VideoImportState } from '../../../../shared/models/videos' | |||
6 | import { getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | 6 | import { getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' |
7 | import { extname, join } from 'path' | 7 | import { extname, join } from 'path' |
8 | import { VideoFileModel } from '../../../models/video/video-file' | 8 | import { VideoFileModel } from '../../../models/video/video-file' |
9 | import { renamePromise, statPromise, unlinkPromise } from '../../../helpers/core-utils' | ||
10 | import { CONFIG, sequelizeTypescript } from '../../../initializers' | 9 | import { CONFIG, sequelizeTypescript } from '../../../initializers' |
11 | import { doRequestAndSaveToFile } from '../../../helpers/requests' | 10 | import { doRequestAndSaveToFile } from '../../../helpers/requests' |
12 | import { VideoState } from '../../../../shared' | 11 | import { VideoState } from '../../../../shared' |
@@ -15,6 +14,7 @@ import { federateVideoIfNeeded } from '../../activitypub' | |||
15 | import { VideoModel } from '../../../models/video/video' | 14 | import { VideoModel } from '../../../models/video/video' |
16 | import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' | 15 | import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' |
17 | import { getSecureTorrentName } from '../../../helpers/utils' | 16 | import { getSecureTorrentName } from '../../../helpers/utils' |
17 | import { rename, stat } from 'fs-extra' | ||
18 | 18 | ||
19 | type VideoImportYoutubeDLPayload = { | 19 | type VideoImportYoutubeDLPayload = { |
20 | type: 'youtube-dl' | 20 | type: 'youtube-dl' |
@@ -114,7 +114,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide | |||
114 | tempVideoPath = await downloader() | 114 | tempVideoPath = await downloader() |
115 | 115 | ||
116 | // Get information about this video | 116 | // Get information about this video |
117 | const stats = await statPromise(tempVideoPath) | 117 | const stats = await stat(tempVideoPath) |
118 | const isAble = await videoImport.User.isAbleToUploadVideo({ size: stats.size }) | 118 | const isAble = await videoImport.User.isAbleToUploadVideo({ size: stats.size }) |
119 | if (isAble === false) { | 119 | if (isAble === false) { |
120 | throw new Error('The user video quota is exceeded with this video to import.') | 120 | throw new Error('The user video quota is exceeded with this video to import.') |
@@ -138,7 +138,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide | |||
138 | 138 | ||
139 | // Move file | 139 | // Move file |
140 | videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile)) | 140 | videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile)) |
141 | await renamePromise(tempVideoPath, videoDestFile) | 141 | await rename(tempVideoPath, videoDestFile) |
142 | tempVideoPath = null // This path is not used anymore | 142 | tempVideoPath = null // This path is not used anymore |
143 | 143 | ||
144 | // Process thumbnail | 144 | // Process thumbnail |
diff --git a/server/lib/schedulers/youtube-dl-update-scheduler.ts b/server/lib/schedulers/youtube-dl-update-scheduler.ts index da47378e8..faadb4334 100644 --- a/server/lib/schedulers/youtube-dl-update-scheduler.ts +++ b/server/lib/schedulers/youtube-dl-update-scheduler.ts | |||
@@ -5,9 +5,9 @@ import { AbstractScheduler } from './abstract-scheduler' | |||
5 | import { SCHEDULER_INTERVALS_MS } from '../../initializers' | 5 | import { SCHEDULER_INTERVALS_MS } from '../../initializers' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
7 | import * as request from 'request' | 7 | import * as request from 'request' |
8 | import { createWriteStream, writeFile } from 'fs-extra' | 8 | import { createWriteStream, ensureDir, writeFile } from 'fs-extra' |
9 | import { join } from 'path' | 9 | import { join } from 'path' |
10 | import { mkdirpPromise, root } from '../../helpers/core-utils' | 10 | import { root } from '../../helpers/core-utils' |
11 | 11 | ||
12 | export class YoutubeDlUpdateScheduler extends AbstractScheduler { | 12 | export class YoutubeDlUpdateScheduler extends AbstractScheduler { |
13 | 13 | ||
@@ -27,7 +27,7 @@ export class YoutubeDlUpdateScheduler extends AbstractScheduler { | |||
27 | const detailsPath = join(binDirectory, 'details') | 27 | const detailsPath = join(binDirectory, 'details') |
28 | const url = 'https://yt-dl.org/downloads/latest/youtube-dl' | 28 | const url = 'https://yt-dl.org/downloads/latest/youtube-dl' |
29 | 29 | ||
30 | await mkdirpPromise(binDirectory) | 30 | await ensureDir(binDirectory) |
31 | 31 | ||
32 | return new Promise(res => { | 32 | return new Promise(res => { |
33 | request.get(url, { followRedirect: false }, (err, result) => { | 33 | request.get(url, { followRedirect: false }, (err, result) => { |
diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts index 51e26c87b..5d73e24fa 100644 --- a/server/models/avatar/avatar.ts +++ b/server/models/avatar/avatar.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' | 3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' |
4 | import { unlinkPromise } from '../../helpers/core-utils' | ||
5 | import { CONFIG, STATIC_PATHS } from '../../initializers' | 4 | import { CONFIG, STATIC_PATHS } from '../../initializers' |
6 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { remove } from 'fs-extra' | ||
7 | 7 | ||
8 | @Table({ | 8 | @Table({ |
9 | tableName: 'avatar' | 9 | tableName: 'avatar' |
@@ -40,6 +40,6 @@ export class AvatarModel extends Model<AvatarModel> { | |||
40 | 40 | ||
41 | removeAvatar () { | 41 | removeAvatar () { |
42 | const avatarPath = join(CONFIG.STORAGE.AVATARS_DIR, this.filename) | 42 | const avatarPath = join(CONFIG.STORAGE.AVATARS_DIR, this.filename) |
43 | return unlinkPromise(avatarPath) | 43 | return remove(avatarPath) |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index 3593646a2..10ef46c14 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts | |||
@@ -19,7 +19,7 @@ import { VideoCaption } from '../../../shared/models/videos/caption/video-captio | |||
19 | import { CONFIG, STATIC_PATHS, VIDEO_LANGUAGES } from '../../initializers' | 19 | import { CONFIG, STATIC_PATHS, VIDEO_LANGUAGES } from '../../initializers' |
20 | import { join } from 'path' | 20 | import { join } from 'path' |
21 | import { logger } from '../../helpers/logger' | 21 | import { logger } from '../../helpers/logger' |
22 | import { unlinkPromise } from '../../helpers/core-utils' | 22 | import { remove } from 'fs-extra' |
23 | 23 | ||
24 | export enum ScopeNames { | 24 | export enum ScopeNames { |
25 | WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' | 25 | WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' |
@@ -172,6 +172,6 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> { | |||
172 | } | 172 | } |
173 | 173 | ||
174 | removeCaptionFile () { | 174 | removeCaptionFile () { |
175 | return unlinkPromise(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName()) | 175 | return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName()) |
176 | } | 176 | } |
177 | } | 177 | } |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index a956da16e..6271db1b3 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -30,15 +30,7 @@ import { VideoPrivacy, VideoResolution, VideoState } from '../../../shared' | |||
30 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' | 30 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' |
31 | import { Video, VideoDetails, VideoFile } from '../../../shared/models/videos' | 31 | import { Video, VideoDetails, VideoFile } from '../../../shared/models/videos' |
32 | import { VideoFilter } from '../../../shared/models/videos/video-query.type' | 32 | import { VideoFilter } from '../../../shared/models/videos/video-query.type' |
33 | import { | 33 | import { createTorrentPromise, peertubeTruncate } from '../../helpers/core-utils' |
34 | copyFilePromise, | ||
35 | createTorrentPromise, | ||
36 | peertubeTruncate, | ||
37 | renamePromise, | ||
38 | statPromise, | ||
39 | unlinkPromise, | ||
40 | writeFilePromise | ||
41 | } from '../../helpers/core-utils' | ||
42 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 34 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
43 | import { isBooleanValid } from '../../helpers/custom-validators/misc' | 35 | import { isBooleanValid } from '../../helpers/custom-validators/misc' |
44 | import { | 36 | import { |
@@ -95,6 +87,7 @@ import { VideoTagModel } from './video-tag' | |||
95 | import { ScheduleVideoUpdateModel } from './schedule-video-update' | 87 | import { ScheduleVideoUpdateModel } from './schedule-video-update' |
96 | import { VideoCaptionModel } from './video-caption' | 88 | import { VideoCaptionModel } from './video-caption' |
97 | import { VideoBlacklistModel } from './video-blacklist' | 89 | import { VideoBlacklistModel } from './video-blacklist' |
90 | import { copy, remove, rename, stat, writeFile } from 'fs-extra' | ||
98 | 91 | ||
99 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation | 92 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation |
100 | const indexes: Sequelize.DefineIndexesOptions[] = [ | 93 | const indexes: Sequelize.DefineIndexesOptions[] = [ |
@@ -1187,7 +1180,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1187 | const filePath = join(CONFIG.STORAGE.TORRENTS_DIR, this.getTorrentFileName(videoFile)) | 1180 | const filePath = join(CONFIG.STORAGE.TORRENTS_DIR, this.getTorrentFileName(videoFile)) |
1188 | logger.info('Creating torrent %s.', filePath) | 1181 | logger.info('Creating torrent %s.', filePath) |
1189 | 1182 | ||
1190 | await writeFilePromise(filePath, torrent) | 1183 | await writeFile(filePath, torrent) |
1191 | 1184 | ||
1192 | const parsedTorrent = parseTorrent(torrent) | 1185 | const parsedTorrent = parseTorrent(torrent) |
1193 | videoFile.infoHash = parsedTorrent.infoHash | 1186 | videoFile.infoHash = parsedTorrent.infoHash |
@@ -1497,14 +1490,14 @@ export class VideoModel extends Model<VideoModel> { | |||
1497 | await transcode(transcodeOptions) | 1490 | await transcode(transcodeOptions) |
1498 | 1491 | ||
1499 | try { | 1492 | try { |
1500 | await unlinkPromise(videoInputPath) | 1493 | await remove(videoInputPath) |
1501 | 1494 | ||
1502 | // Important to do this before getVideoFilename() to take in account the new file extension | 1495 | // Important to do this before getVideoFilename() to take in account the new file extension |
1503 | inputVideoFile.set('extname', newExtname) | 1496 | inputVideoFile.set('extname', newExtname) |
1504 | 1497 | ||
1505 | const videoOutputPath = this.getVideoFilePath(inputVideoFile) | 1498 | const videoOutputPath = this.getVideoFilePath(inputVideoFile) |
1506 | await renamePromise(videoTranscodedPath, videoOutputPath) | 1499 | await rename(videoTranscodedPath, videoOutputPath) |
1507 | const stats = await statPromise(videoOutputPath) | 1500 | const stats = await stat(videoOutputPath) |
1508 | const fps = await getVideoFileFPS(videoOutputPath) | 1501 | const fps = await getVideoFileFPS(videoOutputPath) |
1509 | 1502 | ||
1510 | inputVideoFile.set('size', stats.size) | 1503 | inputVideoFile.set('size', stats.size) |
@@ -1545,7 +1538,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1545 | 1538 | ||
1546 | await transcode(transcodeOptions) | 1539 | await transcode(transcodeOptions) |
1547 | 1540 | ||
1548 | const stats = await statPromise(videoOutputPath) | 1541 | const stats = await stat(videoOutputPath) |
1549 | const fps = await getVideoFileFPS(videoOutputPath) | 1542 | const fps = await getVideoFileFPS(videoOutputPath) |
1550 | 1543 | ||
1551 | newVideoFile.set('size', stats.size) | 1544 | newVideoFile.set('size', stats.size) |
@@ -1560,7 +1553,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1560 | 1553 | ||
1561 | async importVideoFile (inputFilePath: string) { | 1554 | async importVideoFile (inputFilePath: string) { |
1562 | const { videoFileResolution } = await getVideoFileResolution(inputFilePath) | 1555 | const { videoFileResolution } = await getVideoFileResolution(inputFilePath) |
1563 | const { size } = await statPromise(inputFilePath) | 1556 | const { size } = await stat(inputFilePath) |
1564 | const fps = await getVideoFileFPS(inputFilePath) | 1557 | const fps = await getVideoFileFPS(inputFilePath) |
1565 | 1558 | ||
1566 | let updatedVideoFile = new VideoFileModel({ | 1559 | let updatedVideoFile = new VideoFileModel({ |
@@ -1589,7 +1582,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1589 | } | 1582 | } |
1590 | 1583 | ||
1591 | const outputPath = this.getVideoFilePath(updatedVideoFile) | 1584 | const outputPath = this.getVideoFilePath(updatedVideoFile) |
1592 | await copyFilePromise(inputFilePath, outputPath) | 1585 | await copy(inputFilePath, outputPath) |
1593 | 1586 | ||
1594 | await this.createTorrentAndSetInfoHash(updatedVideoFile) | 1587 | await this.createTorrentAndSetInfoHash(updatedVideoFile) |
1595 | 1588 | ||
@@ -1610,25 +1603,25 @@ export class VideoModel extends Model<VideoModel> { | |||
1610 | 1603 | ||
1611 | removeThumbnail () { | 1604 | removeThumbnail () { |
1612 | const thumbnailPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, this.getThumbnailName()) | 1605 | const thumbnailPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, this.getThumbnailName()) |
1613 | return unlinkPromise(thumbnailPath) | 1606 | return remove(thumbnailPath) |
1614 | .catch(err => logger.warn('Cannot delete thumbnail %s.', thumbnailPath, { err })) | 1607 | .catch(err => logger.warn('Cannot delete thumbnail %s.', thumbnailPath, { err })) |
1615 | } | 1608 | } |
1616 | 1609 | ||
1617 | removePreview () { | 1610 | removePreview () { |
1618 | const previewPath = join(CONFIG.STORAGE.PREVIEWS_DIR + this.getPreviewName()) | 1611 | const previewPath = join(CONFIG.STORAGE.PREVIEWS_DIR + this.getPreviewName()) |
1619 | return unlinkPromise(previewPath) | 1612 | return remove(previewPath) |
1620 | .catch(err => logger.warn('Cannot delete preview %s.', previewPath, { err })) | 1613 | .catch(err => logger.warn('Cannot delete preview %s.', previewPath, { err })) |
1621 | } | 1614 | } |
1622 | 1615 | ||
1623 | removeFile (videoFile: VideoFileModel) { | 1616 | removeFile (videoFile: VideoFileModel) { |
1624 | const filePath = join(CONFIG.STORAGE.VIDEOS_DIR, this.getVideoFilename(videoFile)) | 1617 | const filePath = join(CONFIG.STORAGE.VIDEOS_DIR, this.getVideoFilename(videoFile)) |
1625 | return unlinkPromise(filePath) | 1618 | return remove(filePath) |
1626 | .catch(err => logger.warn('Cannot delete file %s.', filePath, { err })) | 1619 | .catch(err => logger.warn('Cannot delete file %s.', filePath, { err })) |
1627 | } | 1620 | } |
1628 | 1621 | ||
1629 | removeTorrent (videoFile: VideoFileModel) { | 1622 | removeTorrent (videoFile: VideoFileModel) { |
1630 | const torrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, this.getTorrentFileName(videoFile)) | 1623 | const torrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, this.getTorrentFileName(videoFile)) |
1631 | return unlinkPromise(torrentPath) | 1624 | return remove(torrentPath) |
1632 | .catch(err => logger.warn('Cannot delete torrent %s.', torrentPath, { err })) | 1625 | .catch(err => logger.warn('Cannot delete torrent %s.', torrentPath, { err })) |
1633 | } | 1626 | } |
1634 | 1627 | ||
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index 90450a0bb..72c9bf9a0 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -13,7 +13,6 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo | 14 | uploadVideo |
15 | } from '../utils' | 15 | } from '../utils' |
16 | import { join } from 'path' | ||
17 | import * as libxmljs from 'libxmljs' | 16 | import * as libxmljs from 'libxmljs' |
18 | import { addVideoCommentThread } from '../utils/videos/video-comments' | 17 | import { addVideoCommentThread } from '../utils/videos/video-comments' |
19 | import { waitJobs } from '../utils/server/jobs' | 18 | import { waitJobs } from '../utils/server/jobs' |
diff --git a/server/tests/utils/feeds/feeds.ts b/server/tests/utils/feeds/feeds.ts index ffd23a1ad..fb480b704 100644 --- a/server/tests/utils/feeds/feeds.ts +++ b/server/tests/utils/feeds/feeds.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { readFileBufferPromise } from '../../../helpers/core-utils' | ||
3 | 2 | ||
4 | type FeedType = 'videos' | 'video-comments' | 3 | type FeedType = 'videos' | 'video-comments' |
5 | 4 | ||
diff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.ts index b0667491b..b2f80e9b1 100644 --- a/server/tests/utils/miscs/miscs.ts +++ b/server/tests/utils/miscs/miscs.ts | |||
@@ -4,7 +4,7 @@ import * as chai from 'chai' | |||
4 | import { isAbsolute, join } from 'path' | 4 | import { isAbsolute, join } from 'path' |
5 | import * as request from 'supertest' | 5 | import * as request from 'supertest' |
6 | import * as WebTorrent from 'webtorrent' | 6 | import * as WebTorrent from 'webtorrent' |
7 | import { readFileBufferPromise } from '../../../helpers/core-utils' | 7 | import { readFile } from 'fs-extra' |
8 | 8 | ||
9 | const expect = chai.expect | 9 | const expect = chai.expect |
10 | let webtorrent = new WebTorrent() | 10 | let webtorrent = new WebTorrent() |
@@ -43,7 +43,7 @@ async function testImage (url: string, imageName: string, imagePath: string, ext | |||
43 | 43 | ||
44 | const body = res.body | 44 | const body = res.body |
45 | 45 | ||
46 | const data = await readFileBufferPromise(join(__dirname, '..', '..', 'fixtures', imageName + extension)) | 46 | const data = await readFile(join(__dirname, '..', '..', 'fixtures', imageName + extension)) |
47 | const minLength = body.length - ((20 * body.length) / 100) | 47 | const minLength = body.length - ((20 * body.length) / 100) |
48 | const maxLength = body.length + ((20 * body.length) / 100) | 48 | const maxLength = body.length + ((20 * body.length) / 100) |
49 | 49 | ||
diff --git a/server/tests/utils/users/accounts.ts b/server/tests/utils/users/accounts.ts index 024a315c7..f82b8d906 100644 --- a/server/tests/utils/users/accounts.ts +++ b/server/tests/utils/users/accounts.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { existsSync } from 'fs-extra' | 4 | import { existsSync, readdir } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { Account } from '../../../../shared/models/actors' | 6 | import { Account } from '../../../../shared/models/actors' |
7 | import { readdirPromise } from '../../../helpers/core-utils' | ||
8 | import { root } from '../index' | 7 | import { root } from '../index' |
9 | import { makeGetRequest } from '../requests/requests' | 8 | import { makeGetRequest } from '../requests/requests' |
10 | 9 | ||
@@ -47,7 +46,7 @@ async function checkActorFilesWereRemoved (actorUUID: string, serverNumber: numb | |||
47 | const directoryExists = existsSync(directoryPath) | 46 | const directoryExists = existsSync(directoryPath) |
48 | expect(directoryExists).to.be.true | 47 | expect(directoryExists).to.be.true |
49 | 48 | ||
50 | const files = await readdirPromise(directoryPath) | 49 | const files = await readdir(directoryPath) |
51 | for (const file of files) { | 50 | for (const file of files) { |
52 | expect(file).to.not.contain(actorUUID) | 51 | expect(file).to.not.contain(actorUUID) |
53 | } | 52 | } |
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 973bbbe87..7eee25402 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts | |||
@@ -1,13 +1,14 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { existsSync, readFile } from 'fs-extra' | 4 | import { existsSync, readdir, readFile } from 'fs-extra' |
5 | import * as parseTorrent from 'parse-torrent' | 5 | import * as parseTorrent from 'parse-torrent' |
6 | import { extname, join } from 'path' | 6 | import { extname, join } from 'path' |
7 | import * as request from 'supertest' | 7 | import * as request from 'supertest' |
8 | import { | 8 | import { |
9 | buildAbsoluteFixturePath, | 9 | buildAbsoluteFixturePath, |
10 | getMyUserInformation, immutableAssign, | 10 | getMyUserInformation, |
11 | immutableAssign, | ||
11 | makeGetRequest, | 12 | makeGetRequest, |
12 | makePutBodyRequest, | 13 | makePutBodyRequest, |
13 | makeUploadRequest, | 14 | makeUploadRequest, |
@@ -16,7 +17,6 @@ import { | |||
16 | testImage | 17 | testImage |
17 | } from '../' | 18 | } from '../' |
18 | import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos' | 19 | import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos' |
19 | import { readdirPromise } from '../../../helpers/core-utils' | ||
20 | import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers' | 20 | import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers' |
21 | import { dateIsValid, webtorrentAdd } from '../index' | 21 | import { dateIsValid, webtorrentAdd } from '../index' |
22 | 22 | ||
@@ -276,7 +276,7 @@ async function checkVideoFilesWereRemoved (videoUUID: string, serverNumber: numb | |||
276 | const directoryExists = existsSync(directoryPath) | 276 | const directoryExists = existsSync(directoryPath) |
277 | expect(directoryExists).to.be.true | 277 | expect(directoryExists).to.be.true |
278 | 278 | ||
279 | const files = await readdirPromise(directoryPath) | 279 | const files = await readdir(directoryPath) |
280 | for (const file of files) { | 280 | for (const file of files) { |
281 | expect(file).to.not.contain(videoUUID) | 281 | expect(file).to.not.contain(videoUUID) |
282 | } | 282 | } |
diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index e49fbb2f5..812600f8b 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts | |||
@@ -5,12 +5,12 @@ import * as program from 'commander' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import * as youtubeDL from 'youtube-dl' | 6 | import * as youtubeDL from 'youtube-dl' |
7 | import { VideoPrivacy } from '../../shared/models/videos' | 7 | import { VideoPrivacy } from '../../shared/models/videos' |
8 | import { unlinkPromise } from '../helpers/core-utils' | ||
9 | import { doRequestAndSaveToFile } from '../helpers/requests' | 8 | import { doRequestAndSaveToFile } from '../helpers/requests' |
10 | import { CONSTRAINTS_FIELDS } from '../initializers' | 9 | import { CONSTRAINTS_FIELDS } from '../initializers' |
11 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' | 10 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' |
12 | import { truncate } from 'lodash' | 11 | import { truncate } from 'lodash' |
13 | import * as prompt from 'prompt' | 12 | import * as prompt from 'prompt' |
13 | import { remove } from 'fs-extra' | ||
14 | 14 | ||
15 | program | 15 | program |
16 | .option('-u, --url <url>', 'Server url') | 16 | .option('-u, --url <url>', 'Server url') |
@@ -204,10 +204,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag | |||
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | await unlinkPromise(videoPath) | 207 | await remove(videoPath) |
208 | if (thumbnailfile) { | 208 | if (thumbnailfile) await remove(thumbnailfile) |
209 | await unlinkPromise(thumbnailfile) | ||
210 | } | ||
211 | 209 | ||
212 | console.log('Uploaded video "%s"!\n', videoAttributes.name) | 210 | console.log('Uploaded video "%s"!\n', videoAttributes.name) |
213 | } | 211 | } |
diff --git a/server/tools/upload.ts b/server/tools/upload.ts index b5630bb9c..796a0f723 100644 --- a/server/tools/upload.ts +++ b/server/tools/upload.ts | |||
@@ -1,13 +1,10 @@ | |||
1 | import * as program from 'commander' | 1 | import * as program from 'commander' |
2 | import { access, constants } from 'fs-extra' | 2 | import { access, constants } from 'fs-extra' |
3 | import { isAbsolute } from 'path' | 3 | import { isAbsolute } from 'path' |
4 | import { promisify } from 'util' | ||
5 | import { getClient, login } from '../tests/utils' | 4 | import { getClient, login } from '../tests/utils' |
6 | import { uploadVideo } from '../tests/utils/index' | 5 | import { uploadVideo } from '../tests/utils/index' |
7 | import { VideoPrivacy } from '../../shared/models/videos' | 6 | import { VideoPrivacy } from '../../shared/models/videos' |
8 | 7 | ||
9 | const accessPromise = promisify(access) | ||
10 | |||
11 | program | 8 | program |
12 | .option('-u, --url <url>', 'Server url') | 9 | .option('-u, --url <url>', 'Server url') |
13 | .option('-U, --username <username>', 'Username') | 10 | .option('-U, --username <username>', 'Username') |
@@ -68,7 +65,7 @@ async function run () { | |||
68 | const res2 = await login(program[ 'url' ], client, user) | 65 | const res2 = await login(program[ 'url' ], client, user) |
69 | const accessToken = res2.body.access_token | 66 | const accessToken = res2.body.access_token |
70 | 67 | ||
71 | await accessPromise(program[ 'file' ], constants.F_OK) | 68 | await access(program[ 'file' ], constants.F_OK) |
72 | 69 | ||
73 | console.log('Uploading %s video...', program[ 'videoName' ]) | 70 | console.log('Uploading %s video...', program[ 'videoName' ]) |
74 | 71 | ||
@@ -116,6 +116,12 @@ | |||
116 | dependencies: | 116 | dependencies: |
117 | "@types/node" "*" | 117 | "@types/node" "*" |
118 | 118 | ||
119 | "@types/fs-extra@^5.0.4": | ||
120 | version "5.0.4" | ||
121 | resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599" | ||
122 | dependencies: | ||
123 | "@types/node" "*" | ||
124 | |||
119 | "@types/geojson@^1.0.0": | 125 | "@types/geojson@^1.0.0": |
120 | version "1.0.6" | 126 | version "1.0.6" |
121 | resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-1.0.6.tgz#3e02972728c69248c2af08d60a48cbb8680fffdf" | 127 | resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-1.0.6.tgz#3e02972728c69248c2af08d60a48cbb8680fffdf" |
@@ -2702,6 +2708,14 @@ fs-extra@^3.0.1: | |||
2702 | jsonfile "^3.0.0" | 2708 | jsonfile "^3.0.0" |
2703 | universalify "^0.1.0" | 2709 | universalify "^0.1.0" |
2704 | 2710 | ||
2711 | fs-extra@^7.0.0: | ||
2712 | version "7.0.0" | ||
2713 | resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.0.tgz#8cc3f47ce07ef7b3593a11b9fb245f7e34c041d6" | ||
2714 | dependencies: | ||
2715 | graceful-fs "^4.1.2" | ||
2716 | jsonfile "^4.0.0" | ||
2717 | universalify "^0.1.0" | ||
2718 | |||
2705 | fs-minipass@^1.2.5: | 2719 | fs-minipass@^1.2.5: |
2706 | version "1.2.5" | 2720 | version "1.2.5" |
2707 | resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" | 2721 | resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" |
@@ -3976,6 +3990,12 @@ jsonfile@^3.0.0: | |||
3976 | optionalDependencies: | 3990 | optionalDependencies: |
3977 | graceful-fs "^4.1.6" | 3991 | graceful-fs "^4.1.6" |
3978 | 3992 | ||
3993 | jsonfile@^4.0.0: | ||
3994 | version "4.0.0" | ||
3995 | resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" | ||
3996 | optionalDependencies: | ||
3997 | graceful-fs "^4.1.6" | ||
3998 | |||
3979 | jsonify@~0.0.0: | 3999 | jsonify@~0.0.0: |
3980 | version "0.0.0" | 4000 | version "0.0.0" |
3981 | resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" | 4001 | resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" |
@@ -6197,7 +6217,7 @@ right-align@^0.1.1: | |||
6197 | dependencies: | 6217 | dependencies: |
6198 | align-text "^0.1.1" | 6218 | align-text "^0.1.1" |
6199 | 6219 | ||
6200 | rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.4.2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@~2.6.2: | 6220 | rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.4.2, rimraf@^2.5.1, rimraf@^2.6.1, rimraf@~2.6.2: |
6201 | version "2.6.2" | 6221 | version "2.6.2" |
6202 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" | 6222 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" |
6203 | dependencies: | 6223 | dependencies: |