diff options
Diffstat (limited to 'scripts/prune-storage.ts')
-rwxr-xr-x | scripts/prune-storage.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |