Skip to content

Commit

Permalink
macos doesn't have realpath
Browse files Browse the repository at this point in the history
we write our own which is very hacky but hopefully functional
  • Loading branch information
tomeichlersmith committed Sep 5, 2023
1 parent 895a7d0 commit 941106b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion denv
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ denv_version=0.2.1
set -o errexit
set -o nounset

if ! hash realpath; then
realpath() {
d="$(dirname "$1")"
d="$(cd "${d}" && pwd -P)"
echo "${d}/$(basename "$1")"
}
fi

# deduce full path to our executable so we can locate the entrypoint executable
denv_fullpath="$(realpath "$0" || true)"
denv_fullpath="$(realpath "$0")"
# deduce full path to entrypoint executable
denv_entrypoint="$(dirname "${denv_fullpath}" || true)/_denv_entrypoint"

Expand Down

0 comments on commit 941106b

Please sign in to comment.