mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Type check safe-chain package
This commit is contained in:
parent
d5dc801c00
commit
c88b1a624f
60 changed files with 1179 additions and 33 deletions
|
|
@ -5,6 +5,17 @@ import windowsPowershell from "./supported-shells/windowsPowershell.js";
|
|||
import fish from "./supported-shells/fish.js";
|
||||
import { ui } from "../environment/userInteraction.js";
|
||||
|
||||
/**
|
||||
* @typedef Shell
|
||||
* @property {string} name
|
||||
* @property {() => boolean} isInstalled
|
||||
* @property {(tools: import("./helpers.js").AikidoTool[]) => boolean} setup
|
||||
* @property {(tools: import("./helpers.js").AikidoTool[]) => boolean} teardown
|
||||
*/
|
||||
|
||||
/**
|
||||
* @returns {Shell[]}
|
||||
*/
|
||||
export function detectShells() {
|
||||
let possibleShells = [zsh, bash, powershell, windowsPowershell, fish];
|
||||
let availableShells = [];
|
||||
|
|
@ -15,7 +26,7 @@ export function detectShells() {
|
|||
availableShells.push(shell);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
ui.writeError(
|
||||
`We were not able to detect which shells are installed on your system. Please check your shell configuration. Error: ${error.message}`
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue