diff --git a/Meta/shell_include.sh b/Meta/shell_include.sh index 864d8c5d143..855ac95514f 100644 --- a/Meta/shell_include.sh +++ b/Meta/shell_include.sh @@ -83,3 +83,14 @@ get_build_dir() { echo "${BUILD_DIR}" } + +absolutize_path() { + directory="$(eval echo "$(dirname "$1")")" + if [ -d "$directory" ]; then + resolved_directory="$(cd "$directory" && pwd)" + echo "${resolved_directory%/}/$(basename "$1")" + else + echo "No such directory: '$directory'" >&2 + return 1 + fi +}