mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
The change to use `go run` over `go build` has upset the windows kokoro builds. Use absolute paths. Change-Id: Id9700529b3460a5ab579f82f616a95c3498c152c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118722 Kokoro: Kokoro <noreply+kokoro@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com> Reviewed-by: James Price <jrprice@google.com>
51 lines
1.2 KiB
Bash
Executable File
51 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2022 The Tint Authors
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -e # Fail on any error.
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
|
|
TOOL="$1"
|
|
|
|
if [ ! -x "$(which go)" ] ; then
|
|
echo "error: go needs to be on \$PATH to use $0"
|
|
exit 1
|
|
fi
|
|
|
|
function list_tools() {
|
|
echo "Available tools:"
|
|
ls "${SCRIPT_DIR}/src/cmd"
|
|
}
|
|
|
|
function show_usage() {
|
|
echo "run <tool> <args>"
|
|
echo
|
|
echo "builds and runs the go tool in <dawn>/tools/src/cmd"
|
|
echo
|
|
list_tools
|
|
exit 1
|
|
}
|
|
|
|
if [ -z "${TOOL}" ]; then
|
|
show_usage
|
|
fi
|
|
|
|
if [ ! -d "${SCRIPT_DIR}/src/cmd/${TOOL}" ]; then
|
|
show_usage
|
|
fi
|
|
|
|
pushd "${SCRIPT_DIR}/.." > /dev/null
|
|
go run "${SCRIPT_DIR}/src/cmd/${TOOL}" "${@:2}"
|
|
popd > /dev/null
|