diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-15 16:30:33 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-15 16:30:33 +0100 |
commit | 1a73a7dcd0d38bebbb2cf7067851fc91b8b7f0d3 (patch) | |
tree | 8689f5121ea0ac09c9181a967083c48e6acc822d | |
parent | 1ec4835dcac769d0711bbfeaa63b4e1743fde265 (diff) | |
download | PeerTube-1a73a7dcd0d38bebbb2cf7067851fc91b8b7f0d3.tar.gz PeerTube-1a73a7dcd0d38bebbb2cf7067851fc91b8b7f0d3.tar.zst PeerTube-1a73a7dcd0d38bebbb2cf7067851fc91b8b7f0d3.zip |
Move cli.ts in a private shared directory
It's only used by cli scripts of this directory
-rw-r--r-- | server/tools/peertube-auth.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-get-access-token.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-import-videos.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-plugins.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-redundancy.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-upload.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube.ts | 2 | ||||
-rw-r--r-- | server/tools/shared/cli.ts (renamed from server/tools/cli.ts) | 5 | ||||
-rw-r--r-- | server/tools/shared/index.ts | 1 |
9 files changed, 10 insertions, 10 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 051156d66..c853469c2 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import CliTable3 from 'cli-table3' | 1 | import CliTable3 from 'cli-table3' |
2 | import { OptionValues, program } from 'commander' | 2 | import { OptionValues, program } from 'commander' |
3 | import { isUserUsernameValid } from '../helpers/custom-validators/users' | 3 | import { isUserUsernameValid } from '../helpers/custom-validators/users' |
4 | import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli' | 4 | import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './shared' |
5 | 5 | ||
6 | import prompt = require('prompt') | 6 | import prompt = require('prompt') |
7 | 7 | ||
diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts index d59a3632e..71a4826e8 100644 --- a/server/tools/peertube-get-access-token.ts +++ b/server/tools/peertube-get-access-token.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { program } from 'commander' | 1 | import { program } from 'commander' |
2 | import { assignToken, buildServer } from './cli' | 2 | import { assignToken, buildServer } from './shared' |
3 | 3 | ||
4 | program | 4 | program |
5 | .option('-u, --url <url>', 'Server url') | 5 | .option('-u, --url <url>', 'Server url') |
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 938eed0ef..bbdaa09c0 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | buildVideoAttributesFromCommander, | 13 | buildVideoAttributesFromCommander, |
14 | getLogger, | 14 | getLogger, |
15 | getServerCredentials | 15 | getServerCredentials |
16 | } from './cli' | 16 | } from './shared' |
17 | 17 | ||
18 | import prompt = require('prompt') | 18 | import prompt = require('prompt') |
19 | 19 | ||
diff --git a/server/tools/peertube-plugins.ts b/server/tools/peertube-plugins.ts index c51d9ebd1..0660c855f 100644 --- a/server/tools/peertube-plugins.ts +++ b/server/tools/peertube-plugins.ts | |||
@@ -2,7 +2,7 @@ import CliTable3 from 'cli-table3' | |||
2 | import { Command, OptionValues, program } from 'commander' | 2 | import { Command, OptionValues, program } from 'commander' |
3 | import { isAbsolute } from 'path' | 3 | import { isAbsolute } from 'path' |
4 | import { PluginType } from '../../shared/models' | 4 | import { PluginType } from '../../shared/models' |
5 | import { assignToken, buildServer, getServerCredentials } from './cli' | 5 | import { assignToken, buildServer, getServerCredentials } from './shared' |
6 | 6 | ||
7 | program | 7 | program |
8 | .name('plugins') | 8 | .name('plugins') |
diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts index 5c82fa420..fd6c760b2 100644 --- a/server/tools/peertube-redundancy.ts +++ b/server/tools/peertube-redundancy.ts | |||
@@ -4,7 +4,7 @@ import { URL } from 'url' | |||
4 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { forceNumber, uniqify } from '@shared/core-utils' | 5 | import { forceNumber, uniqify } from '@shared/core-utils' |
6 | import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models' | 6 | import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models' |
7 | import { assignToken, buildServer, getServerCredentials } from './cli' | 7 | import { assignToken, buildServer, getServerCredentials } from './shared' |
8 | 8 | ||
9 | import bytes = require('bytes') | 9 | import bytes = require('bytes') |
10 | program | 10 | program |
diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 114fe8a29..87da55005 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { program } from 'commander' | 1 | import { program } from 'commander' |
2 | import { access, constants } from 'fs-extra' | 2 | import { access, constants } from 'fs-extra' |
3 | import { isAbsolute } from 'path' | 3 | import { isAbsolute } from 'path' |
4 | import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './cli' | 4 | import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './shared' |
5 | 5 | ||
6 | let command = program | 6 | let command = program |
7 | .name('upload') | 7 | .name('upload') |
diff --git a/server/tools/peertube.ts b/server/tools/peertube.ts index 1d3158044..b79917b4f 100644 --- a/server/tools/peertube.ts +++ b/server/tools/peertube.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | #!/usr/bin/env node | 1 | #!/usr/bin/env node |
2 | 2 | ||
3 | import { CommandOptions, program } from 'commander' | 3 | import { CommandOptions, program } from 'commander' |
4 | import { getSettings, version } from './cli' | 4 | import { getSettings, version } from './shared' |
5 | 5 | ||
6 | program | 6 | program |
7 | .version(version, '-v, --version') | 7 | .version(version, '-v, --version') |
diff --git a/server/tools/cli.ts b/server/tools/shared/cli.ts index 4607d052a..e010ab320 100644 --- a/server/tools/cli.ts +++ b/server/tools/shared/cli.ts | |||
@@ -2,12 +2,11 @@ import { Command } from 'commander' | |||
2 | import { Netrc } from 'netrc-parser' | 2 | import { Netrc } from 'netrc-parser' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { createLogger, format, transports } from 'winston' | 4 | import { createLogger, format, transports } from 'winston' |
5 | import { getAppNumber, isTestInstance } from '@server/helpers/core-utils' | ||
5 | import { loadLanguages } from '@server/initializers/constants' | 6 | import { loadLanguages } from '@server/initializers/constants' |
6 | import { root } from '@shared/core-utils' | 7 | import { root } from '@shared/core-utils' |
7 | import { UserRole } from '@shared/models' | 8 | import { UserRole, VideoPrivacy } from '@shared/models' |
8 | import { PeerTubeServer } from '@shared/server-commands' | 9 | import { PeerTubeServer } from '@shared/server-commands' |
9 | import { VideoPrivacy } from '../../shared/models/videos' | ||
10 | import { getAppNumber, isTestInstance } from '../helpers/core-utils' | ||
11 | 10 | ||
12 | let configName = 'PeerTube/CLI' | 11 | let configName = 'PeerTube/CLI' |
13 | if (isTestInstance()) configName += `-${getAppNumber()}` | 12 | if (isTestInstance()) configName += `-${getAppNumber()}` |
diff --git a/server/tools/shared/index.ts b/server/tools/shared/index.ts new file mode 100644 index 000000000..8a3f31e2f --- /dev/null +++ b/server/tools/shared/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './cli' | |||