| #!/bin/bash |
| # |
| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/helpers.sh || exit $? |
| |
| # Check if sdk-integration has changed. |
| # If it has, the SDK version has changed for the |
| # repo, and the dev will likely want to shut down |
| # things that were run using the old SDK to avoid |
| # incompatibility issues between old things and the new SDK. |
| sdk_folder="third_party/sdk-integration" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${sdk_folder}" | wc -l) -gt 0 ]]; then |
| echo |
| echo-warning "\e[33;1m${sdk_folder}\e[0m has changed." |
| echo-warning "This can lead to incompatiblities with emulators started using the old SDK." |
| echo-warning "We recommend running the following command to clean up resources from the old SDK:" |
| echo-warning '$FUCHSIA_EMBEDDER_DIR/scripts/update_fuchsia_sdk.sh --no-version-bump --cleanup' |
| fi |
| |
| # Check if git hooks have changed. |
| # Prompt the dev to install the new hooks if they have. |
| hooks_folder="hooks" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- hooks | wc -l) -gt 0 ]]; then |
| echo |
| echo-info "\e[33;1mhooks/\e[0m has changed. To install the new Git hooks, run:" |
| echo-info '$FUCHSIA_EMBEDDER_DIR/scripts/install_hooks.sh' |
| fi |
| |
| # Check if the bootstrap script has changed. |
| # Prompt the dev to re-run the bootstrap script in case there's |
| # new additional setup steps they're missing. |
| bootstrap_script="scripts/bootstrap.sh" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${bootstrap_script}" | wc -l) -gt 0 ]]; then |
| echo |
| echo-info "\e[33;1m${bootstrap_script}\e[0m has changed." |
| echo-info "To ensure that your repository is set up correctly, you may want to re-run:" |
| echo-info '$FUCHSIA_EMBEDDER_DIR/scripts/bootstrap.sh' |
| fi |