diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-31 16:56:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-03 08:31:02 +0100 |
commit | a15871560f80e07386c1dabb8370cd2664ecfd1f (patch) | |
tree | 44440e140c9e43b0d7f97ade777a76e649e0553d /server/tools/peertube-repl.ts | |
parent | a22046d166805222ca76060e471b6cb3d419a32d (diff) | |
download | PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip |
Move to eslintcontain
Diffstat (limited to 'server/tools/peertube-repl.ts')
-rw-r--r-- | server/tools/peertube-repl.ts | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/server/tools/peertube-repl.ts b/server/tools/peertube-repl.ts index ab6e215d9..7c936ae0d 100644 --- a/server/tools/peertube-repl.ts +++ b/server/tools/peertube-repl.ts | |||
@@ -1,6 +1,4 @@ | |||
1 | import { registerTSPaths } from '../helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../helpers/register-ts-paths' |
2 | registerTSPaths() | ||
3 | |||
4 | import * as repl from 'repl' | 2 | import * as repl from 'repl' |
5 | import * as path from 'path' | 3 | import * as path from 'path' |
6 | import * as _ from 'lodash' | 4 | import * as _ from 'lodash' |
@@ -23,6 +21,8 @@ import * as signupUtils from '../helpers/signup' | |||
23 | import * as utils from '../helpers/utils' | 21 | import * as utils from '../helpers/utils' |
24 | import * as YoutubeDLUtils from '../helpers/youtube-dl' | 22 | import * as YoutubeDLUtils from '../helpers/youtube-dl' |
25 | 23 | ||
24 | registerTSPaths() | ||
25 | |||
26 | const start = async () => { | 26 | const start = async () => { |
27 | await initDatabaseModels(true) | 27 | await initDatabaseModels(true) |
28 | 28 | ||
@@ -31,22 +31,39 @@ const start = async () => { | |||
31 | const initContext = (replServer) => { | 31 | const initContext = (replServer) => { |
32 | return (context) => { | 32 | return (context) => { |
33 | const properties = { | 33 | const properties = { |
34 | context, repl: replServer, env: process.env, | 34 | context, |
35 | lodash: _, path, | 35 | repl: replServer, |
36 | uuidv1, uuidv3, uuidv4, uuidv5, | 36 | env: process.env, |
37 | cli, logger, constants, | 37 | lodash: _, |
38 | Sequelize, sequelizeTypescript, modelsUtils, | 38 | path, |
39 | models: sequelizeTypescript.models, transaction: sequelizeTypescript.transaction, | 39 | uuidv1, |
40 | query: sequelizeTypescript.query, queryInterface: sequelizeTypescript.getQueryInterface(), | 40 | uuidv3, |
41 | uuidv4, | ||
42 | uuidv5, | ||
43 | cli, | ||
44 | logger, | ||
45 | constants, | ||
46 | Sequelize, | ||
47 | sequelizeTypescript, | ||
48 | modelsUtils, | ||
49 | models: sequelizeTypescript.models, | ||
50 | transaction: sequelizeTypescript.transaction, | ||
51 | query: sequelizeTypescript.query, | ||
52 | queryInterface: sequelizeTypescript.getQueryInterface(), | ||
41 | YoutubeDL, | 53 | YoutubeDL, |
42 | coreUtils, ffmpegUtils, peertubeCryptoUtils, signupUtils, utils, YoutubeDLUtils | 54 | coreUtils, |
55 | ffmpegUtils, | ||
56 | peertubeCryptoUtils, | ||
57 | signupUtils, | ||
58 | utils, | ||
59 | YoutubeDLUtils | ||
43 | } | 60 | } |
44 | 61 | ||
45 | for (let prop in properties) { | 62 | for (const prop in properties) { |
46 | Object.defineProperty(context, prop, { | 63 | Object.defineProperty(context, prop, { |
47 | configurable: false, | 64 | configurable: false, |
48 | enumerable: true, | 65 | enumerable: true, |
49 | value: properties[ prop ] | 66 | value: properties[prop] |
50 | }) | 67 | }) |
51 | } | 68 | } |
52 | } | 69 | } |