aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-19 10:37:35 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit9b474844e85cce916370693cc24f53339a695570 (patch)
tree10b1148a7581a2754e336a144c085a05ce72a1db /scripts
parent32fe00138990627749da58ff9f845584013aa219 (diff)
downloadPeerTube-9b474844e85cce916370693cc24f53339a695570.tar.gz
PeerTube-9b474844e85cce916370693cc24f53339a695570.tar.zst
PeerTube-9b474844e85cce916370693cc24f53339a695570.zip
Add CLI plugins tests
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/plugin/install.ts11
-rwxr-xr-xscripts/travis.sh3
2 files changed, 5 insertions, 9 deletions
diff --git a/scripts/plugin/install.ts b/scripts/plugin/install.ts
index 1725cbeb6..5d7fe4ba0 100755
--- a/scripts/plugin/install.ts
+++ b/scripts/plugin/install.ts
@@ -4,21 +4,16 @@ import { PluginManager } from '../../server/lib/plugins/plugin-manager'
4import { isAbsolute } from 'path' 4import { isAbsolute } from 'path'
5 5
6program 6program
7 .option('-n, --plugin-name [pluginName]', 'Plugin name to install') 7 .option('-n, --npm-name [npmName]', 'Plugin to install')
8 .option('-v, --plugin-version [pluginVersion]', 'Plugin version to install') 8 .option('-v, --plugin-version [pluginVersion]', 'Plugin version to install')
9 .option('-p, --plugin-path [pluginPath]', 'Path of the plugin you want to install') 9 .option('-p, --plugin-path [pluginPath]', 'Path of the plugin you want to install')
10 .parse(process.argv) 10 .parse(process.argv)
11 11
12if (!program['pluginName'] && !program['pluginPath']) { 12if (!program['npmName'] && !program['pluginPath']) {
13 console.error('You need to specify a plugin name with the desired version, or a plugin path.') 13 console.error('You need to specify a plugin name with the desired version, or a plugin path.')
14 process.exit(-1) 14 process.exit(-1)
15} 15}
16 16
17if (program['pluginName'] && !program['pluginVersion']) {
18 console.error('You need to specify a the version of the plugin you want to install.')
19 process.exit(-1)
20}
21
22if (program['pluginPath'] && !isAbsolute(program['pluginPath'])) { 17if (program['pluginPath'] && !isAbsolute(program['pluginPath'])) {
23 console.error('Plugin path should be absolute.') 18 console.error('Plugin path should be absolute.')
24 process.exit(-1) 19 process.exit(-1)
@@ -34,6 +29,6 @@ run()
34async function run () { 29async function run () {
35 await initDatabaseModels(true) 30 await initDatabaseModels(true)
36 31
37 const toInstall = program['pluginName'] || program['pluginPath'] 32 const toInstall = program['npmName'] || program['pluginPath']
38 await PluginManager.Instance.install(toInstall, program['pluginVersion'], !!program['pluginPath']) 33 await PluginManager.Instance.install(toInstall, program['pluginVersion'], !!program['pluginPath'])
39} 34}
diff --git a/scripts/travis.sh b/scripts/travis.sh
index 664d9fd6c..42e2329c6 100755
--- a/scripts/travis.sh
+++ b/scripts/travis.sh
@@ -14,7 +14,8 @@ if [ "$1" = "misc" ]; then
14 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/client.ts \ 14 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/client.ts \
15 server/tests/feeds/index.ts \ 15 server/tests/feeds/index.ts \
16 server/tests/misc-endpoints.ts \ 16 server/tests/misc-endpoints.ts \
17 server/tests/helpers/index.ts 17 server/tests/helpers/index.ts \
18 server/tests/plugins/index.ts
18elif [ "$1" = "cli" ]; then 19elif [ "$1" = "cli" ]; then
19 npm run build:server 20 npm run build:server
20 CC=gcc-4.9 CXX=g++-4.9 npm run setup:cli 21 CC=gcc-4.9 CXX=g++-4.9 npm run setup:cli