import { realpath as fs_realpath } from "fs" ; import { callback } from "awaiting" ; const HOME = process . env . SMC_LOCAL_HUB_HOME ?? process . env . HOME ; export async function realpath ( path ) { const fullpath = HOME + "/" + path ; const rpath = await callback ( fs_realpath , fullpath ) ; if ( rpath == fullpath || ! rpath . startsWith ( HOME + "/" ) ) { return path ; } return rpath . slice ( ( HOME + "/" ) . length ) ; }