diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-03 08:23:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-03 08:23:59 +0200 |
commit | c74cd9feaba583fc40c61d1c3a7c036267a56ea1 (patch) | |
tree | 560e4fb6597eb4f02b93c94d57ff4d16b8060886 | |
parent | 21d70a7302c0d03ae8cc538a97d4b279c4da5792 (diff) | |
download | PeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.tar.gz PeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.tar.zst PeerTube-c74cd9feaba583fc40c61d1c3a7c036267a56ea1.zip |
Fix removing directory content
-rw-r--r-- | server/initializers/installer.ts | 3 |
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 @@ | |||
1 | import { ensureDir, readdir, remove } from 'fs-extra' | 1 | import { ensureDir, readdir, remove } from 'fs-extra' |
2 | import passwordGenerator from 'password-generator' | 2 | import passwordGenerator from 'password-generator' |
3 | import { join } from 'path' | ||
3 | import { UserRole } from '@shared/models' | 4 | import { UserRole } from '@shared/models' |
4 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
5 | import { buildUser, createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' | 6 | import { 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 | } |