mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 10:46:39 +00:00
24 lines
385 B
Bash
Executable File
24 lines
385 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
resolve_link() {
|
|
"$(command -v greadlink || command -v readlink)" "$1"
|
|
}
|
|
|
|
abs_dirname() {
|
|
local path="$1"
|
|
local name
|
|
local cwd
|
|
cwd="$(pwd)"
|
|
|
|
while [ -n "$path" ]; do
|
|
cd "${path%/*}" || exit 1
|
|
name="${path##*/}"
|
|
path="$(resolve_link "$name" || true)"
|
|
done
|
|
|
|
pwd
|
|
cd "$cwd" || exit 1
|
|
}
|
|
|
|
exec "$(dirname "$(abs_dirname "$0")")/Emacs" "$@"
|