blob: d8dce634c701d08b1b4049f8c42a3fd40df285de [file] [log] [blame]
#!/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.
set -e
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/..
readonly REPO_ROOT="${REPO_ROOT}"
readonly SDK_MANIFEST_PATH="${REPO_ROOT}/bazel_rules_fuchsia/fuchsia/manifests/core_sdk.ensure"
get_sdk_version() {
if [[ $(cat "${SDK_MANIFEST_PATH}") =~ fuchsia/sdk/core.*\ version:(.*)$ ]]; then
echo ${BASH_REMATCH[1]}
else
echo "Cannot find SDK Version"
exit 1
fi
}
main() {
get_sdk_version
}
main "$@"