mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
So that it allows depot tools has the ability to write the cipd pkgs outside of the repo. windows support will be added in a follow-up change. Bug: 355430412 Change-Id: I7fabed7ecac8216ba3f3f639217d9e36746241f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5742434 Reviewed-by: Gregory Guterman <guterman@google.com> Commit-Queue: Yiwei Zhang <yiwzhang@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
33 lines
922 B
Bash
33 lines
922 B
Bash
# Copyright 2017 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
function cipd_bin_setup {
|
|
local MYPATH="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
|
|
local ENSURE="$MYPATH/cipd_manifest.txt"
|
|
local ROOT="$MYPATH/.cipd_bin"
|
|
|
|
UNAME="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
|
|
case $UNAME in
|
|
cygwin*)
|
|
ENSURE="$(cygpath -w $ENSURE)"
|
|
ROOT="$(cygpath -w $ROOT)"
|
|
;;
|
|
esac
|
|
|
|
# value in .cipd_client_root file overrides the default root.
|
|
CIPD_ROOT_OVERRIDE_FILE="${MYPATH}/.cipd_client_root"
|
|
if [ -f "${CIPD_ROOT_OVERRIDE_FILE}" ]; then
|
|
ROOT=$(<"${CIPD_ROOT_OVERRIDE_FILE}")
|
|
fi
|
|
|
|
(
|
|
source "$MYPATH/cipd" ensure \
|
|
-log-level warning \
|
|
-ensure-file "$ENSURE" \
|
|
-root "$ROOT"
|
|
)
|
|
|
|
echo $ROOT
|
|
}
|