mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
Meta: Add cross-platform function for absolutizing paths
This commit is contained in:
parent
8132587b3b
commit
cd0b9c4ec0
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user