Skip to content

Commit

Permalink
chore(NA): move the instruction to remove yarn global bazelisk packag…
Browse files Browse the repository at this point in the history
…e into the first place on install bazel tools (#91026) (#91058)
  • Loading branch information
mistic committed Feb 11, 2021
1 parent ef775d6 commit 87b12e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48147,13 +48147,13 @@ async function installBazelTools(repoRootPath) {
const bazeliskVersion = await readBazelToolsVersionFile(repoRootPath, '.bazeliskversion');
const bazelVersion = await readBazelToolsVersionFile(repoRootPath, '.bazelversion'); // Check what globals are installed

_log__WEBPACK_IMPORTED_MODULE_4__["log"].debug(`[bazel_tools] verify if bazelisk is installed`); // Test if bazelisk is already installed in the correct version
_log__WEBPACK_IMPORTED_MODULE_4__["log"].debug(`[bazel_tools] verify if bazelisk is installed`); // Check if we need to remove bazelisk from yarn

const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion); // Test if bazel bin is available
await tryRemoveBazeliskFromYarnGlobal(); // Test if bazelisk is already installed in the correct version

const isBazelBinAlreadyAvailable = await isBazelBinAvailable(); // Check if we need to remove bazelisk from yarn
const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion); // Test if bazel bin is available

await tryRemoveBazeliskFromYarnGlobal(); // Install bazelisk if not installed
const isBazelBinAlreadyAvailable = await isBazelBinAvailable(); // Install bazelisk if not installed

if (!isBazeliskPkgInstalled || !isBazelBinAlreadyAvailable) {
_log__WEBPACK_IMPORTED_MODULE_4__["log"].info(`[bazel_tools] installing Bazel tools`);
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-pm/src/utils/bazel/install_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ export async function installBazelTools(repoRootPath: string) {
// Check what globals are installed
log.debug(`[bazel_tools] verify if bazelisk is installed`);

// Check if we need to remove bazelisk from yarn
await tryRemoveBazeliskFromYarnGlobal();

// Test if bazelisk is already installed in the correct version
const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion);

// Test if bazel bin is available
const isBazelBinAlreadyAvailable = await isBazelBinAvailable();

// Check if we need to remove bazelisk from yarn
await tryRemoveBazeliskFromYarnGlobal();

// Install bazelisk if not installed
if (!isBazeliskPkgInstalled || !isBazelBinAlreadyAvailable) {
log.info(`[bazel_tools] installing Bazel tools`);
Expand Down

0 comments on commit 87b12e8

Please sign in to comment.