aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-22 10:55:28 +0200
committerChocobozzz <me@florianbigard.com>2021-04-22 10:55:28 +0200
commit302eba0d898e38dca14739486441c27c0be6c62f (patch)
tree280d18bfe2ad1b16248277371e609c31d6b3aaa4 /server/lib/plugins/plugin-manager.ts
parent3e0e8d4afded28559b7c473061bbdc31ab542e1c (diff)
downloadPeerTube-302eba0d898e38dca14739486441c27c0be6c62f.tar.gz
PeerTube-302eba0d898e38dca14739486441c27c0be6c62f.tar.zst
PeerTube-302eba0d898e38dca14739486441c27c0be6c62f.zip
Add data directory for plugins and some helpers
Diffstat (limited to 'server/lib/plugins/plugin-manager.ts')
-rw-r--r--server/lib/plugins/plugin-manager.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index ae05af721..ba9814383 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -1,7 +1,7 @@
1import decache from 'decache' 1import decache from 'decache'
2import * as express from 'express' 2import * as express from 'express'
3import { createReadStream, createWriteStream } from 'fs' 3import { createReadStream, createWriteStream } from 'fs'
4import { outputFile, readJSON } from 'fs-extra' 4import { ensureDir, outputFile, readJSON } from 'fs-extra'
5import { basename, join } from 'path' 5import { basename, join } from 'path'
6import { MOAuthTokenUser, MUser } from '@server/types/models' 6import { MOAuthTokenUser, MUser } from '@server/types/models'
7import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' 7import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model'
@@ -428,6 +428,9 @@ export class PluginManager implements ServerHook {
428 } 428 }
429 429
430 const { registerOptions, registerStore } = this.getRegisterHelpers(npmName, plugin) 430 const { registerOptions, registerStore } = this.getRegisterHelpers(npmName, plugin)
431
432 await ensureDir(registerOptions.peertubeHelpers.plugin.getDataDirectoryPath())
433
431 library.register(registerOptions) 434 library.register(registerOptions)
432 .catch(err => logger.error('Cannot register plugin %s.', npmName, { err })) 435 .catch(err => logger.error('Cannot register plugin %s.', npmName, { err }))
433 436