moz.sh (1176B)
1 #!/usr/bin/env bash 2 # This Source Code Form is subject to the terms of the Mozilla Public 3 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6 # This script vendors all ProseMirror packages in this directory. 7 8 set -euo pipefail 9 10 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 11 MACH=$(realpath "$SCRIPT_DIR/../../../mach") 12 ROOT_MOZ_YAML="$SCRIPT_DIR/moz.yaml" 13 14 # Vendor root moz.yaml first 15 if [[ -f "$ROOT_MOZ_YAML" ]]; then 16 echo "Vendoring $ROOT_MOZ_YAML" 17 "$MACH" vendor "$ROOT_MOZ_YAML" "$@" || true 18 fi 19 20 for manifest in "$SCRIPT_DIR"/prosemirror-*/moz.yaml; do 21 echo "Vendoring $manifest" 22 # Always pass --ignore-modified to subfolder vendoring since a previous run 23 # might have modified `moz.yaml` files. 24 if ! "$MACH" vendor "$manifest" --ignore-modified "$@"; then 25 code=$? 26 # Continue on spurious-check exit 27 if [[ $code -eq 254 ]]; then 28 echo "Vendored $manifest with success code $code; continuing" 29 else 30 echo "Vendoring failed for $manifest with exit code $code" 31 exit "$code" 32 fi 33 fi 34 done 35 36 # Build the bundle 37 "$SCRIPT_DIR/make_bundle.sh"