File: run-cargo-hack.sh

package info (click to toggle)
rust-swc-core 35.0.0~ds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,816 kB
  • sloc: javascript: 873; xml: 538; sh: 358; makefile: 35; python: 5
file content (21 lines) | stat: -rwxr-xr-x 545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -eu

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

crate=$1

echo "Running cargo hack for crate $crate"

# yq query syntax is weird, so we have to use jq
json_str="$(yq -o=json $SCRIPT_DIR/../../tests.yml)"


if echo $json_str | jq -e ".check.\"$crate\"" > /dev/null; then
    check_commands=$(echo $json_str | jq -e -r ".check.\"$crate\" | .[]")

    while IFS= read -r line; do
        echo "    Running '$line'"
        (cd "crates/$crate" && $line)
    done <<< "$check_commands"
fi