mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
97b0e4c591
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5596 GitOrigin-RevId: c5da90eb4e61a9d9a5ddc34f7bfbaa2d00c698b8
26 lines
801 B
Bash
Executable File
26 lines
801 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" # ... https://stackoverflow.com/a/246128/176841
|
|
cd "$PROJECT_ROOT"
|
|
|
|
TYPES_PROJECT_DIR="./dc-api-types"
|
|
PROJECT_DIR_NAMES=( "reference" "sqlite" )
|
|
|
|
TYPES_VERSION=$( jq '.version' "$TYPES_PROJECT_DIR/package.json" )
|
|
echo "Updating projects dependant on API types to version $TYPES_VERSION..."
|
|
|
|
for project in "${PROJECT_DIR_NAMES[@]}"; do
|
|
PROJECT_DIR="./$project"
|
|
echo "Updating $project..."
|
|
|
|
TMP_FILE="$( mktemp )"
|
|
jq ".dependencies[\"@hasura/dc-api-types\"] = $TYPES_VERSION" "$PROJECT_DIR/package.json" > "$TMP_FILE"
|
|
mv -f "$TMP_FILE" "$PROJECT_DIR/package.json"
|
|
done
|
|
|
|
npm install
|
|
make derive-lockfiles
|
|
|
|
echo "Done updating API types version in dependant projects"
|