Brad Fitzpatrick 2690b4762f Revert "VERSION.txt: this is v1.78.0"
This reverts commit 0267fe83b200f1702a2fa0a395442c02a053fadb.

Reason: it converted the tree to Windows line endings.

Updates #14299

Change-Id: I2271a61d43e99bd0bbcf9f4831e8783e570ba08a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-12-05 15:27:16 -08:00

44 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Run a command with our local yarn install, rather than any globally installed
# instance.
set -euo pipefail
if [[ "${CI:-}" == "true" ]]; then
set -x
fi
(
if [[ "${CI:-}" == "true" ]]; then
set -x
fi
repo_root="${BASH_SOURCE%/*}/../"
cd "$repo_root"
./tool/node --version >/dev/null # Ensure node is unpacked and ready
cachedir="$HOME/.cache/tailscale-yarn"
tarball="${cachedir}.tar.gz"
read -r want_rev < "./tool/yarn.rev"
got_rev=""
if [[ -x "${cachedir}/bin/yarn" ]]; then
got_rev=$(PATH="$HOME/.cache/tailscale-node/bin:$PATH" "${cachedir}/bin/yarn" --version)
fi
if [[ "$want_rev" != "$got_rev" ]]; then
rm -rf "$cachedir" "$tarball"
mkdir -p "$cachedir"
curl -f -L -o "$tarball" "https://github.com/yarnpkg/yarn/releases/download/v${want_rev}/yarn-v${want_rev}.tar.gz"
(cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
rm -f "$tarball"
fi
)
# Deliberately not using cachedir here, to keep the environment
# completely pristine for execution of yarn.
export PATH="$HOME/.cache/tailscale-node/bin:$HOME/.cache/tailscale-yarn/bin:$PATH"
exec "$HOME/.cache/tailscale-yarn/bin/yarn" "$@"