4# Script to copy ssz.go files from bazel build folder to appropriate location.
5# Bazel builds to bazel-bin/... folder, script copies them back to original folder where target is.
6
7bazel query 'kind(ssz_gen_marshal, //proto/...)' | xargs bazel build $@ 8
9# Get locations of proto ssz.go files.
10file_list=()
4# Script to copy pb.go files from bazel build folder to appropriate location.
5# Bazel builds to bazel-bin/... folder, script copies them back to original folder where .proto is.
6
7bazel query 'attr(testonly, 0, //proto/...)' | xargs bazel build $@ 8
9file_list=()
10while IFS= read -d $'\0' -r file; do
Double quotes around $@
(and similarly, ${array[@]}
) prevents globbing and word splitting of individual elements, while still expanding to multiple separate arguments.
Let's say you have four arguments: baz
, foo bar
, *
and /*/*/*/*
.
"$@"
will expand into exactly that: baz
, foo bar
, *
and /*/*/*/*
.
$@
will expand into multiple other arguments: baz
, foo
, bar
, file.txt
, otherfile.jpg
, and (eventually) a list of most files on the system.
Since the latter is rarely expected or desired, this issue warns you about it.
cp $@ ~/dir
cp "$@" ~/dir