2018-03-02 20:33:26 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
source="${BASH_SOURCE[0]}"
|
|
|
|
|
2018-08-13 22:53:20 +03:00
|
|
|
# resolve $SOURCE until the file is no longer a symlink
|
|
|
|
while [[ -h $source ]]; do
|
2018-03-02 20:33:26 +03:00
|
|
|
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
|
|
|
source="$(readlink "$source")"
|
2018-08-13 22:53:20 +03:00
|
|
|
|
|
|
|
# if $source was a relative symlink, we need to resolve it relative to the path where the
|
2018-03-02 20:33:26 +03:00
|
|
|
# symlink file was located
|
|
|
|
[[ $source != /* ]] && source="$scriptroot/$source"
|
|
|
|
done
|
|
|
|
|
2018-08-13 22:53:20 +03:00
|
|
|
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
|
|
|
"$scriptroot/eng/common/build.sh" --restore $@
|