diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
commit | 62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch) | |
tree | c45c35d35d7a3e32621fba06edc63646930c8efd /scripts/prune-storage.ts | |
parent | 84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff) | |
download | PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip |
Correctly migrate to fs-extra
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) { |