Files
carbon-lang/bazel/sh_run/exec.sh
T
Jon Ross-Perkins fd455ed36b Add convenience .run targets for test files. (#2384)
e.g., for `//explorer/testdata:tuple/no_ending_comma.carbon.test`, `bazel run //explorer/testdata:tuple/no_ending_comma.carbon.run`
2022-11-14 08:39:56 -08:00

17 lines
505 B
Bash
Executable File

#!/usr/bin/env bash
#
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Turn any pwd-relative files into absolute paths. Other args may be
# BUILD_WORKING_DIRECTORY-relative, which will be handled by the executed
# binary.
ARGS=("$@")
for i in "${!ARGS[@]}"; do
if [[ -e "${ARGS[$i]}" ]]; then
ARGS[$i]="$(realpath ${ARGS[$i]})"
fi
done
exec "${ARGS[@]}"