mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Cleanup
This commit is contained in:
parent
1cf8fd1241
commit
d064d46668
32 changed files with 429 additions and 400 deletions
|
|
@ -3,7 +3,6 @@ import {
|
|||
doesExecutableExistOnSystem,
|
||||
removeLinesMatchingPattern,
|
||||
getScriptsDir,
|
||||
getSafeChainDir,
|
||||
} from "../helpers.js";
|
||||
import { execSync } from "child_process";
|
||||
import path from "path";
|
||||
|
|
@ -53,15 +52,6 @@ function teardown(tools) {
|
|||
function setup() {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
const customDir = getSafeChainDir();
|
||||
if (customDir) {
|
||||
addLineToFile(
|
||||
startupFile,
|
||||
`export SAFE_CHAIN_DIR="${customDir}" # Safe-chain installation directory`,
|
||||
eol
|
||||
);
|
||||
}
|
||||
|
||||
addLineToFile(
|
||||
startupFile,
|
||||
`source ${path.join(getScriptsDir(), "init-posix.sh")} # Safe-chain Zsh initialization script`,
|
||||
|
|
@ -86,18 +76,7 @@ function getStartupFile() {
|
|||
|
||||
/** @param {string} preamble */
|
||||
function buildManualInstructions(preamble) {
|
||||
const customDir = getSafeChainDir();
|
||||
const instructions = [preamble];
|
||||
|
||||
if (customDir) {
|
||||
instructions.push(
|
||||
` export SAFE_CHAIN_DIR="${customDir}"`,
|
||||
` source ${path.join(getScriptsDir(), "init-posix.sh")}`,
|
||||
);
|
||||
} else {
|
||||
instructions.push(` source ~/.safe-chain/scripts/init-posix.sh`);
|
||||
}
|
||||
|
||||
const instructions = [preamble, ` source ${path.join(getScriptsDir(), "init-posix.sh")}`];
|
||||
instructions.push(`Then restart your terminal or run: source ~/.zshrc`);
|
||||
return instructions;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue