Some fixes

This commit is contained in:
Reinier Criel 2026-04-13 13:32:55 -07:00
parent f7324ccfc0
commit 38a8130f4a
2 changed files with 5 additions and 2 deletions

View file

@ -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;
} }

View file

@ -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