Yokan / rebuild
Course 1 8624561

yokan-version.sh

scripts/yokan-version.sh

configuration / resource19 lines
1#!/bin/sh2# Source with REPO_ROOT set. Exports the same release metadata as Gradle/Xcode.3YOKAN_VERSION="${YOKAN_VERSION:-$(awk '$1 == "YOKAN_VERSION" && $2 == "=" {print $3; exit}' "$REPO_ROOT/version.xcconfig")}"4YOKAN_VERSION="${YOKAN_VERSION#v}"5if ! printf '%s\n' "$YOKAN_VERSION" | awk -F. '6  NF != 3 { exit 1 }7  { for (i = 1; i <= 3; i++) if ($i !~ /^(0|[1-9][0-9]*)$/) exit 1 }8  $1 > 2099 || $2 > 999 || $3 > 999 { exit 1 }9'; then10  echo "error: Yokan version must be MAJOR.MINOR.PATCH within platform version-code limits" >&211  exit 212fi13YOKAN_RELEASE_CHANNEL="$(printf '%s\n' "$YOKAN_VERSION" | awk -F. '{print ($1 > 0 ? "stable" : ($2 > 0 ? "beta" : "alpha"))}')"14YOKAN_VERSION_CODE="${YOKAN_VERSION_CODE:-$(printf '%s\n' "$YOKAN_VERSION" | awk -F. '{code = $1 * 1000000 + $2 * 1000 + $3; printf "%.0f", (code > 0 ? code : 1)}')}"15if ! printf '%s\n' "$YOKAN_VERSION_CODE" | awk '$0 !~ /^[1-9][0-9]*$/ || $0 > 2100000000 {exit 1}'; then16  echo "error: Yokan versionCode must be between 1 and 2100000000" >&217  exit 218fi19export YOKAN_VERSION YOKAN_RELEASE_CHANNEL YOKAN_VERSION_CODE20

Search chapters, reference and source filenames.