blob: 6a77b0ae3c65100352d785fdbda2849a9a08a0f5 [file] [log] [blame]
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
WORKSPACE=../../engine.code-workspace
cleaned_temp_file=$(mktemp)
json5 "$WORKSPACE" -s 2 -o "$cleaned_temp_file"
yaml_temp_file=$(mktemp)
yq eval -P "$cleaned_temp_file" > "$yaml_temp_file"
merged_temp_file=$(mktemp)
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' \
"$yaml_temp_file" engine-workspace.yaml > "$merged_temp_file" && \
mv "$merged_temp_file" engine-workspace.yaml
rm "$yaml_temp_file"
rm "$cleaned_temp_file"