Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/lib/office.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { legacyOfficeDownloadsDir, officeDownloadsDir } from "@/lib/paths.js";

// `codevhub skill office`: fetch the CoDev Office offline bundle (published by
// the codev-storage MinIO backend) for this OS and run the bundled setup
// script, which installs the Office skills (DOCX, XLSX, PPTX and PDF).
// script, which installs the Office skills (DOCX, XLSX, PPTX and PDF) into the
// global ~/.claude/skills dir (read by Claude Code and CoDev Code). codevhub
// passes no skills-root — the destination is the setup script's own default,
// which also detects the signed-in user under a different-account Windows
// elevation, so codevhub must not pin a path that would defeat that.
// File names are deterministic per platform — no manifest fetch — and each
// bundle carries its own SHA256SUMS.txt that the setup flow can verify.
// Non-interactive on purpose — the second half hands the terminal to an
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/download.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
return 0;
},
);
expect(code).toBe(0);

Check failure on line 351 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > --download-only stages both files and never spawns

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ tests/lib/download.test.ts:351:16
expect(spawns).toEqual([]);
expect(readFileSync(join(dir, bundleName)).equals(BUNDLE)).toBe(true);
expect(readFileSync(join(dir, scriptName)).equals(SCRIPT)).toBe(true);
Expand All @@ -365,7 +365,7 @@
return 0;
},
);
expect(code).toBe(0);

Check failure on line 368 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > runs the installer via bash with translated flags

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ tests/lib/download.test.ts:368:16
expect(spawned).toEqual({
command: "bash",
args: [join(dir, scriptName), "--skip-verify"],
Expand All @@ -376,7 +376,7 @@
test("propagates the installer's exit code", async () => {
const dir = join(tempDir, "office");
const code = await runSkillOffice(["--dir", dir], baseUrl, async () => 7);
expect(code).toBe(7);

Check failure on line 379 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > propagates the installer's exit code

AssertionError: expected 1 to be 7 // Object.is equality - Expected + Received - 7 + 1 ❯ tests/lib/download.test.ts:379:16
});

test("a cross-platform --platform forces download-only", async () => {
Expand Down Expand Up @@ -429,14 +429,14 @@
const line = officeManualWindowsCommand("codev-office-windows-setup.ps1", [
"-SkipVerify",
"-SkillsRoot",
"C:\\Users\\Van Phong\\.config\\codev\\skills",
"C:\\Users\\Van Phong\\.claude\\skills",
]);
expect(line).toContain(
"powershell -ExecutionPolicy Bypass -File .\\codev-office-windows-setup.ps1 -SkipVerify",
);
// Space-containing paths are quoted so copy-paste survives them.
expect(line).toContain(
'-SkillsRoot "C:\\Users\\Van Phong\\.config\\codev\\skills"',
'-SkillsRoot "C:\\Users\\Van Phong\\.claude\\skills"',
);
});

Expand All @@ -448,7 +448,7 @@
const fallback = join(tempDir, "fallback-office");
try {
const dir = ensureStagingDir(preferred, fallback);
expect(dir).toBe(fallback);

Check failure on line 451 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > ensureStagingDir falls back when the preferred dir is unwritable

AssertionError: expected 'C:\Users\RUNNER~1\AppData\Local\Temp\…' to be 'C:\Users\RUNNER~1\AppData\Local\Temp\…' // Object.is equality Expected: "C:\Users\RUNNER~1\AppData\Local\Temp\codev-download-I5j91G\fallback-office" Received: "C:\Users\RUNNER~1\AppData\Local\Temp\codev-download-I5j91G\locked\codev-office" ❯ tests/lib/download.test.ts:451:16
expect(existsSync(fallback)).toBe(true);
} finally {
chmodSync(locked, 0o755);
Expand Down Expand Up @@ -485,7 +485,7 @@
["--download-only", "--dir", dir],
baseUrl,
);
expect(code).toBe(0);

Check failure on line 488 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > always refetches the setup script, but reuses a finished bundle

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ tests/lib/download.test.ts:488:16
expect(readFileSync(join(dir, scriptName)).equals(SCRIPT)).toBe(true);
// No checksum to disagree with, so the existing bundle is trusted as-is.
expect(readFileSync(join(dir, bundleName), "utf8")).toBe("stale-bundle");
Expand All @@ -502,7 +502,7 @@
["--download-only", "--dir", dir],
baseUrl,
);
expect(code).toBe(0);

Check failure on line 505 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > drops a stale .partial for the script instead of resuming onto it

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ tests/lib/download.test.ts:505:16
expect(readFileSync(join(dir, scriptName)).equals(SCRIPT)).toBe(true);
// Both requests went out without a Range header.
expect(rangeLog).toEqual([undefined, undefined]);
Expand Down Expand Up @@ -565,7 +565,7 @@
return 0;
},
);
expect(code).toBe(0);

Check failure on line 568 in tests/lib/download.test.ts

View workflow job for this annotation

GitHub Actions / matrix (windows-latest)

tests/lib/download.test.ts > runSkillOffice > --uninstall fetches only the uninstall script and runs it with passthroughs

AssertionError: expected 1 to be +0 // Object.is equality - Expected + Received - 0 + 1 ❯ tests/lib/download.test.ts:568:16
expect(spawned).toEqual({
command: "bash",
args: [join(dir, uninstallName), "--yes", "--skills-only"],
Expand Down
Loading