Merge 732983ee72 into 09be5d45d5
This commit is contained in:
commit
700dadc1da
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -16,6 +16,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -101,6 +105,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -217,6 +225,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -293,6 +305,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -389,6 +405,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
|
||||
@ -4,6 +4,8 @@ import type { runExec } from "../process/exec.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { ensureBinary } from "./binaries.js";
|
||||
|
||||
const expectedCmd = process.platform === "win32" ? "where" : "which";
|
||||
|
||||
describe("ensureBinary", () => {
|
||||
it("passes through when binary exists", async () => {
|
||||
const exec: typeof runExec = vi.fn().mockResolvedValue({
|
||||
@ -16,7 +18,7 @@ describe("ensureBinary", () => {
|
||||
exit: vi.fn(),
|
||||
};
|
||||
await ensureBinary("node", exec, runtime);
|
||||
expect(exec).toHaveBeenCalledWith("which", ["node"]);
|
||||
expect(exec).toHaveBeenCalledWith(expectedCmd, ["node"]);
|
||||
});
|
||||
|
||||
it("logs and exits when missing", async () => {
|
||||
|
||||
@ -7,7 +7,9 @@ export async function ensureBinary(
|
||||
runtime: RuntimeEnv = defaultRuntime,
|
||||
): Promise<void> {
|
||||
// Abort early if a required CLI tool is missing.
|
||||
await exec("which", [name]).catch(() => {
|
||||
// Use `where` on Windows, `which` elsewhere.
|
||||
const cmd = process.platform === "win32" ? "where" : "which";
|
||||
await exec(cmd, [name]).catch(() => {
|
||||
runtime.error(`Missing required binary: ${name}. Please install it.`);
|
||||
runtime.exit(1);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user