aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-repl.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 16:56:52 +0100
committerChocobozzz <me@florianbigard.com>2020-02-03 08:31:02 +0100
commita15871560f80e07386c1dabb8370cd2664ecfd1f (patch)
tree44440e140c9e43b0d7f97ade777a76e649e0553d /server/tools/peertube-repl.ts
parenta22046d166805222ca76060e471b6cb3d419a32d (diff)
downloadPeerTube-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.ts41
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 @@
1import { registerTSPaths } from '../helpers/register-ts-paths' 1import { registerTSPaths } from '../helpers/register-ts-paths'
2registerTSPaths()
3
4import * as repl from 'repl' 2import * as repl from 'repl'
5import * as path from 'path' 3import * as path from 'path'
6import * as _ from 'lodash' 4import * as _ from 'lodash'
@@ -23,6 +21,8 @@ import * as signupUtils from '../helpers/signup'
23import * as utils from '../helpers/utils' 21import * as utils from '../helpers/utils'
24import * as YoutubeDLUtils from '../helpers/youtube-dl' 22import * as YoutubeDLUtils from '../helpers/youtube-dl'
25 23
24registerTSPaths()
25
26const start = async () => { 26const 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 }