Handle comments from the PR

This commit is contained in:
Sander Declerck 2025-07-18 14:23:51 +02:00
parent 6c269a1bb5
commit 36c195f5a9
No known key found for this signature in database
14 changed files with 166 additions and 181 deletions

View file

@ -3,15 +3,23 @@ import bash from "./supported-shells/bash.js";
import powershell from "./supported-shells/powershell.js";
import windowsPowershell from "./supported-shells/windowsPowershell.js";
import fish from "./supported-shells/fish.js";
import { ui } from "../environment/userInteraction.js";
export function detectShells() {
let possibleShells = [zsh, bash, powershell, windowsPowershell, fish];
let availableShells = [];
for (const shell of possibleShells) {
if (shell.isInstalled()) {
availableShells.push(shell);
try {
for (const shell of possibleShells) {
if (shell.isInstalled()) {
availableShells.push(shell);
}
}
} catch (error) {
ui.writeError(
`We were not able to detect which shells are installed on your system. Please check your shell configuration. Error: ${error.message}`
);
return [];
}
return availableShells;