...
1#!/usr/bin/env bash
2
3set -o errexit
4set -o nounset
5set -o pipefail
6
7if [[ -n "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then # Running inside bazel
8 echo "Ejecting content to the working tree, hold on tight" >&2
9elif ! command -v bazel &>/dev/null; then
10 echo "Install bazel via `just hack/bazelisk`" >&2
11 exit 1
12else
13 echo "This script should be ran via a Bazel target."
14 exit 1
15fi
16
17src_path=$(realpath "$1")
18out_path="$2"
19
20cd "${BUILD_WORKSPACE_DIRECTORY}"
21
22echo "Starting Copy to directory: ${src_path}"
23
24rsync --no-perms -vh -r "$src_path/" $out_path --delete-before
25
26echo "Copy to ${out_path} completed"
View as plain text