Skip to content

Commit

Permalink
stop writing yarn output to the terminal, just run it quietly and pri…
Browse files Browse the repository at this point in the history
…nt the output if it fails
  • Loading branch information
spalger committed Aug 27, 2020
1 parent c8f56f3 commit 8f8bae2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ it('builds a generated plugin into a viable archive', async () => {
│ succ 1 bundles compiled successfully after <time>
info copying source into the build and converting with babel
info running yarn to install dependencies
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info compressing plugin into [fooTestPlugin-7.5.0.zip]
Done in <time>."
`);
Expand Down
22 changes: 4 additions & 18 deletions packages/kbn-plugin-helpers/src/tasks/yarn_install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,13 @@ const winVersion = (path: string) => (process.platform === 'win32' ? `${path}.cm

export async function yarnInstall({ log, buildDir, config }: BuildContext) {
const pkgJson = Path.resolve(buildDir, 'package.json');
const yarnLock = Path.resolve(buildDir, 'yarn.lock');

if (config?.skipInstallDependencies || !Fs.existsSync(pkgJson)) {
return;
}

if (yarnLock) {
log.info('running yarn to install dependencies\n\n');

await execa(winVersion('yarn'), ['install', '--production', '--pure-lockfile'], {
cwd: buildDir,
stdio: 'inherit',
});
} else {
log.info('running npm to install dependencies\n\n');

await execa(winVersion('npm'), ['install', '--production'], {
cwd: buildDir,
stdio: 'inherit',
});
}

log.write('\n');
log.info('running yarn to install dependencies');
await execa(winVersion('yarn'), ['install', '--production', '--pure-lockfile'], {
cwd: buildDir,
});
}

0 comments on commit 8f8bae2

Please sign in to comment.