mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Meta: Add cross-platform function for absolutizing paths
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user