diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-19 14:36:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 09071200c73f5358e1d0bfb61a274e4f2c4ec52b (patch) | |
tree | 602749b149df1675518846dd223105196b19a557 /server/lib/plugins/yarn.ts | |
parent | 9b474844e85cce916370693cc24f53339a695570 (diff) | |
download | PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.gz PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.zst PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.zip |
Add plugin API tests
Diffstat (limited to 'server/lib/plugins/yarn.ts')
-rw-r--r-- | server/lib/plugins/yarn.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/plugins/yarn.ts b/server/lib/plugins/yarn.ts index 74c67653c..e40351b6e 100644 --- a/server/lib/plugins/yarn.ts +++ b/server/lib/plugins/yarn.ts | |||
@@ -13,7 +13,9 @@ async function installNpmPlugin (npmName: string, version?: string) { | |||
13 | let toInstall = npmName | 13 | let toInstall = npmName |
14 | if (version) toInstall += `@${version}` | 14 | if (version) toInstall += `@${version}` |
15 | 15 | ||
16 | await execYarn('add ' + toInstall) | 16 | const { stdout } = await execYarn('add ' + toInstall) |
17 | |||
18 | logger.debug('Added a yarn package.', { yarnStdout: stdout }) | ||
17 | } | 19 | } |
18 | 20 | ||
19 | async function installNpmPluginFromDisk (path: string) { | 21 | async function installNpmPluginFromDisk (path: string) { |
@@ -46,7 +48,7 @@ async function execYarn (command: string) { | |||
46 | await outputJSON(pluginPackageJSON, {}) | 48 | await outputJSON(pluginPackageJSON, {}) |
47 | } | 49 | } |
48 | 50 | ||
49 | await execShell(`yarn ${command}`, { cwd: pluginDirectory }) | 51 | return execShell(`yarn ${command}`, { cwd: pluginDirectory }) |
50 | } catch (result) { | 52 | } catch (result) { |
51 | logger.error('Cannot exec yarn.', { command, err: result.err, stderr: result.stderr }) | 53 | logger.error('Cannot exec yarn.', { command, err: result.err, stderr: result.stderr }) |
52 | 54 | ||