Some more cleanup

This commit is contained in:
Reinier Criel 2026-04-10 15:33:30 -07:00
parent ccd595fc22
commit 98dcda78da
5 changed files with 40 additions and 94 deletions

View file

@ -141,9 +141,10 @@ function cygpathw(path) {
}
}
function getManualTeardownInstructions() {
/** @param {string} preamble */
function buildManualInstructions(preamble) {
const customDir = getSafeChainDir();
const instructions = [`Remove the following line from your ~/.bashrc file:`];
const instructions = [preamble];
if (customDir) {
instructions.push(
@ -158,21 +159,12 @@ function getManualTeardownInstructions() {
return instructions;
}
function getManualTeardownInstructions() {
return buildManualInstructions(`Remove the following line from your ~/.bashrc file:`);
}
function getManualSetupInstructions() {
const customDir = getSafeChainDir();
const instructions = [`Add the following line to your ~/.bashrc file:`];
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`);
}
instructions.push(`Then restart your terminal or run: source ~/.bashrc`);
return instructions;
return buildManualInstructions(`Add the following line to your ~/.bashrc file:`);
}
/**

View file

@ -84,11 +84,10 @@ function getStartupFile() {
}
}
function getManualTeardownInstructions() {
/** @param {string} preamble */
function buildManualInstructions(preamble) {
const customDir = getSafeChainDir();
const instructions = [
`Remove the following line from your ~/.config/fish/config.fish file:`,
];
const instructions = [preamble];
if (customDir) {
instructions.push(
@ -105,25 +104,12 @@ function getManualTeardownInstructions() {
return instructions;
}
function getManualTeardownInstructions() {
return buildManualInstructions(`Remove the following line from your ~/.config/fish/config.fish file:`);
}
function getManualSetupInstructions() {
const customDir = getSafeChainDir();
const instructions = [
`Add the following line to your ~/.config/fish/config.fish file:`,
];
if (customDir) {
instructions.push(
` set -gx SAFE_CHAIN_DIR "${customDir}"`,
` source ${path.join(getScriptsDir(), "init-fish.fish")}`,
);
} else {
instructions.push(` source ~/.safe-chain/scripts/init-fish.fish`);
}
instructions.push(
`Then restart your terminal or run: source ~/.config/fish/config.fish`,
);
return instructions;
return buildManualInstructions(`Add the following line to your ~/.config/fish/config.fish file:`);
}
/**

View file

@ -87,11 +87,10 @@ function getStartupFile() {
}
}
function getManualTeardownInstructions() {
/** @param {string} preamble */
function buildManualInstructions(preamble) {
const customDir = getSafeChainDir();
const instructions = [
`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`,
];
const instructions = [preamble];
if (customDir) {
instructions.push(
@ -106,23 +105,12 @@ function getManualTeardownInstructions() {
return instructions;
}
function getManualTeardownInstructions() {
return buildManualInstructions(`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`);
}
function getManualSetupInstructions() {
const customDir = getSafeChainDir();
const instructions = [
`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`,
];
if (customDir) {
instructions.push(
` $env:SAFE_CHAIN_DIR = '${customDir}'`,
` . "${path.join(getScriptsDir(), "init-pwsh.ps1")}"`,
);
} else {
instructions.push(` . "$HOME\\.safe-chain\\scripts\\init-pwsh.ps1"`);
}
instructions.push(`Then restart your terminal or run: . $PROFILE`);
return instructions;
return buildManualInstructions(`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`);
}
/**

View file

@ -87,11 +87,10 @@ function getStartupFile() {
}
}
function getManualTeardownInstructions() {
/** @param {string} preamble */
function buildManualInstructions(preamble) {
const customDir = getSafeChainDir();
const instructions = [
`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`,
];
const instructions = [preamble];
if (customDir) {
instructions.push(
@ -106,23 +105,12 @@ function getManualTeardownInstructions() {
return instructions;
}
function getManualTeardownInstructions() {
return buildManualInstructions(`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`);
}
function getManualSetupInstructions() {
const customDir = getSafeChainDir();
const instructions = [
`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`,
];
if (customDir) {
instructions.push(
` $env:SAFE_CHAIN_DIR = '${customDir}'`,
` . "${path.join(getScriptsDir(), "init-pwsh.ps1")}"`,
);
} else {
instructions.push(` . "$HOME\\.safe-chain\\scripts\\init-pwsh.ps1"`);
}
instructions.push(`Then restart your terminal or run: . $PROFILE`);
return instructions;
return buildManualInstructions(`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`);
}
/**

View file

@ -84,9 +84,10 @@ function getStartupFile() {
}
}
function getManualTeardownInstructions() {
/** @param {string} preamble */
function buildManualInstructions(preamble) {
const customDir = getSafeChainDir();
const instructions = [`Remove the following line from your ~/.zshrc file:`];
const instructions = [preamble];
if (customDir) {
instructions.push(
@ -101,21 +102,12 @@ function getManualTeardownInstructions() {
return instructions;
}
function getManualTeardownInstructions() {
return buildManualInstructions(`Remove the following line from your ~/.zshrc file:`);
}
function getManualSetupInstructions() {
const customDir = getSafeChainDir();
const instructions = [`Add the following line to your ~/.zshrc file:`];
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`);
}
instructions.push(`Then restart your terminal or run: source ~/.zshrc`);
return instructions;
return buildManualInstructions(`Add the following line to your ~/.zshrc file:`);
}
export default {