mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Do not hardcode path in setup-ci
This commit is contained in:
parent
a0fb8d6b3d
commit
422963b38a
2 changed files with 3 additions and 2 deletions
|
|
@ -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 });
|
||||||
|
|
|
||||||
|
|
@ -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"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue