aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/installer.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-03 08:23:59 +0200
committerChocobozzz <me@florianbigard.com>2022-05-03 08:23:59 +0200
commitc74cd9feaba583fc40c61d1c3a7c036267a56ea1 (patch)
tree560e4fb6597eb4f02b93c94d57ff4d16b8060886 /server/initializers/installer.ts
parent21d70a7302c0d03ae8cc538a97d4b279c4da5792 (diff)
downloadPeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.tar.gz
PeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.tar.zst
PeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.zip
Fix removing directory content
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r--server/initializers/installer.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index c18998244..0364bdbe5 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -1,5 +1,6 @@
1import { ensureDir, readdir, remove } from 'fs-extra' 1import { ensureDir, readdir, remove } from 'fs-extra'
2import passwordGenerator from 'password-generator' 2import passwordGenerator from 'password-generator'
3import { join } from 'path'
3import { UserRole } from '@shared/models' 4import { UserRole } from '@shared/models'
4import { logger } from '../helpers/logger' 5import { logger } from '../helpers/logger'
5import { buildUser, createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' 6import { buildUser, createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user'
@@ -67,7 +68,7 @@ async function removeDirectoryOrContent (dir: string) {
67 const files = await readdir(dir) 68 const files = await readdir(dir)
68 69
69 for (const file of files) { 70 for (const file of files) {
70 await remove(file) 71 await remove(join(dir, file))
71 } 72 }
72 } 73 }
73} 74}