mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Meta: Add cross-platform function for absolutizing paths
This commit is contained in:
parent
8132587b3b
commit
cd0b9c4ec0
Notes:
github-actions[bot]
2024-10-29 11:31:33 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/cd0b9c4ec0b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2031
1 changed files with 11 additions and 0 deletions
|
@ -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 a new issue