"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_bin_which = require('../../bin/which.js');

//#region src/external-tools/bazel/from-path.ts
/**
* @file `bazelFromPath()` — looks for `bazelisk` first, then `bazel`, on the
*   system PATH. Bazelisk is preferred because it honors `.bazelversion` and
*   downloads the project-pinned Bazel into its own cache — closer to what real
*   Bazel users want. Returns `undefined` if neither is found on PATH.
*/
async function bazelFromPath() {
	const bazelisk = await require_bin_which.which("bazelisk", { nothrow: true });
	/* c8 ignore start - reached only when bazelisk is on PATH. */
	if (typeof bazelisk === "string") return {
		path: bazelisk,
		source: "path"
	};
	/* c8 ignore stop */
	const bazel = await require_bin_which.which("bazel", { nothrow: true });
	/* c8 ignore start - reached only when bazel is on PATH. */
	if (typeof bazel === "string") return {
		path: bazel,
		source: "path"
	};
}

//#endregion
exports.bazelFromPath = bazelFromPath;