diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-22 10:55:28 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-22 10:55:28 +0200 |
commit | 302eba0d898e38dca14739486441c27c0be6c62f (patch) | |
tree | 280d18bfe2ad1b16248277371e609c31d6b3aaa4 /server/lib/plugins/plugin-manager.ts | |
parent | 3e0e8d4afded28559b7c473061bbdc31ab542e1c (diff) | |
download | PeerTube-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.ts | 5 |
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 @@ | |||
1 | import decache from 'decache' | 1 | import decache from 'decache' |
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import { createReadStream, createWriteStream } from 'fs' | 3 | import { createReadStream, createWriteStream } from 'fs' |
4 | import { outputFile, readJSON } from 'fs-extra' | 4 | import { ensureDir, outputFile, readJSON } from 'fs-extra' |
5 | import { basename, join } from 'path' | 5 | import { basename, join } from 'path' |
6 | import { MOAuthTokenUser, MUser } from '@server/types/models' | 6 | import { MOAuthTokenUser, MUser } from '@server/types/models' |
7 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' | 7 | import { 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 | ||