devops: fix "ensure-depot-tools" script (#13303)
The script should is supposed to be sourced and thus should not change any env variables of parent script besides `$PATH`.
This commit is contained in:
parent
6ef8b63e5d
commit
786b4a55fc
|
|
@ -11,6 +11,7 @@ if [[ $sourced == 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
function ensure_depot_tools() {
|
||||
# Install depot_tools if they are not in system, and modify $PATH
|
||||
# to include depot_tools
|
||||
if ! command -v autoninja >/dev/null; then
|
||||
|
|
@ -20,9 +21,12 @@ if ! command -v autoninja >/dev/null; then
|
|||
echo "ERROR: cannot automatically install depot_tools on windows. Please, install manually"
|
||||
exit 1
|
||||
fi
|
||||
SCRIPT_PATH=$(cd "$(dirname "$BASH_SOURCE")"; pwd -P)
|
||||
local SCRIPT_PATH=$(cd "$(dirname "$BASH_SOURCE")"; pwd -P)
|
||||
if [[ ! -d "${SCRIPT_PATH}/depot_tools" ]]; then
|
||||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${SCRIPT_PATH}/depot_tools"
|
||||
fi
|
||||
export PATH="${SCRIPT_PATH}/depot_tools:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_depot_tools
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ fi
|
|||
function prepare_chromium_checkout {
|
||||
cd "${SCRIPT_PATH}"
|
||||
|
||||
source "${SCRIPT_PATH}/chromium/UPSTREAM_CONFIG.sh"
|
||||
source "${SCRIPT_PATH}/chromium/ensure_depot_tools.sh"
|
||||
|
||||
if [[ -z "${CR_CHECKOUT_PATH}" ]]; then
|
||||
|
|
@ -55,7 +56,6 @@ function prepare_chromium_checkout {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
source "${SCRIPT_PATH}/chromium/UPSTREAM_CONFIG.sh"
|
||||
cd "${CR_CHECKOUT_PATH}/src"
|
||||
gclient sync --with_branch_heads
|
||||
git fetch origin
|
||||
|
|
|
|||
Loading…
Reference in a new issue