mirror of https://github.com/rwf2/Rocket.git
Use readlink on Linux.
This commit is contained in:
parent
4a0984891a
commit
8ff92efc93
|
@ -4,7 +4,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
function relative() {
|
function relative() {
|
||||||
local full_path="${SCRIPT_DIR}/../${1}"
|
local full_path="${SCRIPT_DIR}/../${1}"
|
||||||
echo $(realpath "${full_path}")
|
|
||||||
|
# Use readlink as a fallback to readpath for cross-platform compat.
|
||||||
|
if ! command -v realpath >/dev/null 2>&1; then
|
||||||
|
echo $(readlink -f "${full_path}")
|
||||||
|
else
|
||||||
|
echo $(realpath "${full_path}")
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
EXAMPLES_DIR=$(relative "examples")
|
EXAMPLES_DIR=$(relative "examples")
|
||||||
|
|
Loading…
Reference in New Issue