]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Move cli.ts in a private shared directory
authorChocobozzz <me@florianbigard.com>
Wed, 15 Feb 2023 15:30:33 +0000 (16:30 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 15 Feb 2023 15:30:33 +0000 (16:30 +0100)
It's only used by cli scripts of this directory

server/tools/peertube-auth.ts
server/tools/peertube-get-access-token.ts
server/tools/peertube-import-videos.ts
server/tools/peertube-plugins.ts
server/tools/peertube-redundancy.ts
server/tools/peertube-upload.ts
server/tools/peertube.ts
server/tools/shared/cli.ts [moved from server/tools/cli.ts with 97% similarity]
server/tools/shared/index.ts [new file with mode: 0644]

index 051156d6682396352953e46c0dca577b3ca97321..c853469c27f286f52a8cf9cde9562c1491904761 100644 (file)
@@ -1,7 +1,7 @@
 import CliTable3 from 'cli-table3'
 import { OptionValues, program } from 'commander'
 import { isUserUsernameValid } from '../helpers/custom-validators/users'
-import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli'
+import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './shared'
 
 import prompt = require('prompt')
 
index d59a3632e4e4bec56fccebbaf05d501db500b308..71a4826e8f90e5f2410aee535a1238e9c742bf86 100644 (file)
@@ -1,5 +1,5 @@
 import { program } from 'commander'
-import { assignToken, buildServer } from './cli'
+import { assignToken, buildServer } from './shared'
 
 program
   .option('-u, --url <url>', 'Server url')
index 938eed0ef5255ff96405efaa400b2d1426c4edd0..bbdaa09c0b40dce14026a85cd704bd32538be48c 100644 (file)
@@ -13,7 +13,7 @@ import {
   buildVideoAttributesFromCommander,
   getLogger,
   getServerCredentials
-} from './cli'
+} from './shared'
 
 import prompt = require('prompt')
 
index c51d9ebd143a29ff4579356d78b21c9d36165dc6..0660c855f6d409565d08d110be725bda6e572954 100644 (file)
@@ -2,7 +2,7 @@ import CliTable3 from 'cli-table3'
 import { Command, OptionValues, program } from 'commander'
 import { isAbsolute } from 'path'
 import { PluginType } from '../../shared/models'
-import { assignToken, buildServer, getServerCredentials } from './cli'
+import { assignToken, buildServer, getServerCredentials } from './shared'
 
 program
   .name('plugins')
index 5c82fa420367efc9e2fd90e04f49bec2b06fc02d..fd6c760b23de6fb212047b22d72076a5468a20da 100644 (file)
@@ -4,7 +4,7 @@ import { URL } from 'url'
 import validator from 'validator'
 import { forceNumber, uniqify } from '@shared/core-utils'
 import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models'
-import { assignToken, buildServer, getServerCredentials } from './cli'
+import { assignToken, buildServer, getServerCredentials } from './shared'
 
 import bytes = require('bytes')
 program
index 114fe8a290da599583d91fdb760b1e32d378a7b8..87da5500509eb0e896e4538f56f8526c583c4332 100644 (file)
@@ -1,7 +1,7 @@
 import { program } from 'commander'
 import { access, constants } from 'fs-extra'
 import { isAbsolute } from 'path'
-import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './cli'
+import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './shared'
 
 let command = program
   .name('upload')
index 1d3158044c7f33f171615d123ea72dfdacbaa019..b79917b4fe0b4600bdabacc34160b2648b4fb0fd 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env node
 
 import { CommandOptions, program } from 'commander'
-import { getSettings, version } from './cli'
+import { getSettings, version } from './shared'
 
 program
   .version(version, '-v, --version')
similarity index 97%
rename from server/tools/cli.ts
rename to server/tools/shared/cli.ts
index 4607d052a9a19051fe0b9c009a0a85aa08f4bdb8..e010ab320e88c4181f59feb37df6b629174e2650 100644 (file)
@@ -2,12 +2,11 @@ import { Command } from 'commander'
 import { Netrc } from 'netrc-parser'
 import { join } from 'path'
 import { createLogger, format, transports } from 'winston'
+import { getAppNumber, isTestInstance } from '@server/helpers/core-utils'
 import { loadLanguages } from '@server/initializers/constants'
 import { root } from '@shared/core-utils'
-import { UserRole } from '@shared/models'
+import { UserRole, VideoPrivacy } from '@shared/models'
 import { PeerTubeServer } from '@shared/server-commands'
-import { VideoPrivacy } from '../../shared/models/videos'
-import { getAppNumber, isTestInstance } from '../helpers/core-utils'
 
 let configName = 'PeerTube/CLI'
 if (isTestInstance()) configName += `-${getAppNumber()}`
diff --git a/server/tools/shared/index.ts b/server/tools/shared/index.ts
new file mode 100644 (file)
index 0000000..8a3f31e
--- /dev/null
@@ -0,0 +1 @@
+export * from './cli'