#!/bin/bash -eu # # script/version # mas # # Displays the current marketing version of mas. # # This no longer works with MARKETING_VERSION build setting in Info.plist # agvtool what-marketing-version -terse1 mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")" if ! cd -- "${mas_dir}"; then printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2 exit 1 fi VERSION=$(git describe --abbrev=0 --tags) VERSION=${VERSION#v} cat <"Sources/mas/Package.swift" /// Generated by \`script/version\`. enum Package { static let version = "${VERSION}" } EOF echo "${VERSION}"