aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
commit62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch)
treec45c35d35d7a3e32621fba06edc63646930c8efd /scripts
parent84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff)
downloadPeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz
PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst
PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip
Correctly migrate to fs-extra
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/prune-storage.ts6
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 @@
1import * as prompt from 'prompt' 1import * as prompt from 'prompt'
2import { join } from 'path' 2import { join } from 'path'
3import { readdirPromise, unlinkPromise } from '../server/helpers/core-utils'
4import { CONFIG } from '../server/initializers/constants' 3import { CONFIG } from '../server/initializers/constants'
5import { VideoModel } from '../server/models/video/video' 4import { VideoModel } from '../server/models/video/video'
6import { initDatabaseModels } from '../server/initializers' 5import { initDatabaseModels } from '../server/initializers'
6import { remove, readdir } from 'fs-extra'
7 7
8run() 8run()
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
51async function pruneDirectory (directory: string) { 51async 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) {