mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Some fixes
This commit is contained in:
parent
f7324ccfc0
commit
38a8130f4a
2 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
/** @type {NodeJS.Process & { pkg?: unknown }} */
|
||||||
|
const processWithPkg = process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} executablePath
|
* @param {string} executablePath
|
||||||
* @returns {string | undefined}
|
* @returns {string | undefined}
|
||||||
|
|
@ -28,7 +31,7 @@ export function deriveInstallDirFromExecutablePath(executablePath) {
|
||||||
* @returns {string | undefined}
|
* @returns {string | undefined}
|
||||||
*/
|
*/
|
||||||
export function getInstalledSafeChainDir(options = {}) {
|
export function getInstalledSafeChainDir(options = {}) {
|
||||||
const isPackaged = options.isPackaged ?? Boolean(process.pkg);
|
const isPackaged = options.isPackaged ?? Boolean(processWithPkg.pkg);
|
||||||
if (!isPackaged) {
|
if (!isPackaged) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ _get_safe_chain_script_path() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
eval 'printf "%s\n" "${(%):-%N}"'
|
eval 'printf "%s\n" "${(%):-%x}"'
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue