Add regular setup support

This commit is contained in:
Reinier Criel 2026-04-10 12:09:40 -07:00
parent 1635bee387
commit 24af6f21eb
23 changed files with 575 additions and 48 deletions

View file

@ -2,8 +2,10 @@ import {
addLineToFile,
doesExecutableExistOnSystem,
removeLinesMatchingPattern,
getScriptsDir,
} from "../helpers.js";
import { execSync } from "child_process";
import path from "path";
const shellName = "Fish";
const executableName = "fish";
@ -31,10 +33,10 @@ function teardown(tools) {
);
}
// Removes the line that sources the safe-chain fish initialization script (~/.safe-chain/scripts/init-fish.fish)
// Removes the line that sources the safe-chain fish initialization script (any path, requires safe-chain comment)
removeLinesMatchingPattern(
startupFile,
/^source\s+~\/\.safe-chain\/scripts\/init-fish\.fish/,
/^source\s+.*init-fish\.fish.*#\s*Safe-chain/,
eol
);
@ -46,7 +48,7 @@ function setup() {
addLineToFile(
startupFile,
`source ~/.safe-chain/scripts/init-fish.fish # Safe-chain Fish initialization script`,
`source ${path.join(getScriptsDir(), "init-fish.fish")} # Safe-chain Fish initialization script`,
eol
);