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
|
|
@ -15,6 +15,11 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../helpers.js").AikidoTool[]} tools
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
|
|
@ -57,13 +62,18 @@ function getStartupFile() {
|
|||
}).trim();
|
||||
|
||||
return windowsFixPath(path);
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
throw new Error(
|
||||
`Command failed: ${startupFileCommand}. Error: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} path
|
||||
*
|
||||
* @returns {string}
|
||||
*/
|
||||
function windowsFixPath(path) {
|
||||
try {
|
||||
if (os.platform() !== "win32") {
|
||||
|
|
@ -93,6 +103,11 @@ function hasCygpath() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} path
|
||||
*
|
||||
* @returns {string}
|
||||
*/
|
||||
function cygpathw(path) {
|
||||
try {
|
||||
var result = spawnSync("cygpath", ["-w", path], {
|
||||
|
|
@ -108,6 +123,9 @@ function cygpathw(path) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("../shellDetection.js").Shell}
|
||||
*/
|
||||
export default {
|
||||
name: shellName,
|
||||
isInstalled,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../helpers.js").AikidoTool[]} tools
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
|
|
@ -54,13 +59,16 @@ function getStartupFile() {
|
|||
encoding: "utf8",
|
||||
shell: executableName,
|
||||
}).trim();
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
throw new Error(
|
||||
`Command failed: ${startupFileCommand}. Error: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("../shellDetection.js").Shell}
|
||||
*/
|
||||
export default {
|
||||
name: shellName,
|
||||
isInstalled,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,11 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../helpers.js").AikidoTool[]} tools
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
|
|
@ -50,13 +55,16 @@ function getStartupFile() {
|
|||
encoding: "utf8",
|
||||
shell: executableName,
|
||||
}).trim();
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
throw new Error(
|
||||
`Command failed: ${startupFileCommand}. Error: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("../shellDetection.js").Shell}
|
||||
*/
|
||||
export default {
|
||||
name: shellName,
|
||||
isInstalled,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,11 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../helpers.js").AikidoTool[]} tools
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
|
|
@ -50,13 +55,16 @@ function getStartupFile() {
|
|||
encoding: "utf8",
|
||||
shell: executableName,
|
||||
}).trim();
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
throw new Error(
|
||||
`Command failed: ${startupFileCommand}. Error: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("../shellDetection.js").Shell}
|
||||
*/
|
||||
export default {
|
||||
name: shellName,
|
||||
isInstalled,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../helpers.js").AikidoTool[]} tools
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
|
|
@ -54,7 +59,7 @@ function getStartupFile() {
|
|||
encoding: "utf8",
|
||||
shell: executableName,
|
||||
}).trim();
|
||||
} catch (error) {
|
||||
} catch (/** @type {any} */ error) {
|
||||
throw new Error(
|
||||
`Command failed: ${startupFileCommand}. Error: ${error.message}`
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue