Do not hardcode path in setup-ci

This commit is contained in:
Reinier Criel 2026-04-10 09:05:29 -07:00
parent a0fb8d6b3d
commit 422963b38a
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,6 @@
import chalk from "chalk"; import chalk from "chalk";
import { ui } from "../environment/userInteraction.js"; import { ui } from "../environment/userInteraction.js";
import { getPackageManagerList, knownAikidoTools, getShimsDir } from "./helpers.js"; import { getPackageManagerList, knownAikidoTools, getShimsDir, getBinDir } from "./helpers.js";
import fs from "fs"; import fs from "fs";
import os from "os"; import os from "os";
import path from "path"; import path from "path";
@ -31,7 +31,7 @@ export async function setupCi() {
ui.emptyLine(); ui.emptyLine();
const shimsDir = getShimsDir(); const shimsDir = getShimsDir();
const binDir = path.join(os.homedir(), ".safe-chain", "bin"); const binDir = getBinDir();
// Create the shims directory if it doesn't exist // Create the shims directory if it doesn't exist
if (!fs.existsSync(shimsDir)) { if (!fs.existsSync(shimsDir)) {
fs.mkdirSync(shimsDir, { recursive: true }); fs.mkdirSync(shimsDir, { recursive: true });

View file

@ -51,6 +51,7 @@ describe("Setup CI shell integration", () => {
], ],
getPackageManagerList: () => "npm, yarn", getPackageManagerList: () => "npm, yarn",
getShimsDir: () => mockShimsDir, getShimsDir: () => mockShimsDir,
getBinDir: () => path.join(mockHomeDir, ".safe-chain", "bin"),
}, },
}); });