blob: c7e1fdf0c2611e416d27f8c0fe48ee07ffb96150 [file] [log] [blame]
# 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)"/ || 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.
if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${sdk_folder}" | wc -l) -gt 0 ]]; then
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/ --no-version-bump --cleanup'
# Check if git hooks have changed.
# Prompt the dev to install the new hooks if they have.
if [[ $(git diff HEAD@{1}..HEAD@{0} -- hooks | wc -l) -gt 0 ]]; then
echo-info "\e[33;1mhooks/\e[0m has changed. To install the new Git hooks, run:"
echo-info '$FUCHSIA_EMBEDDER_DIR/scripts/'
# 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.
if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${bootstrap_script}" | wc -l) -gt 0 ]]; then
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/'