2024-09-30 15:28:25 +00:00
|
|
|
#!/bin/bash -eu
|
2019-01-13 07:18:35 +00:00
|
|
|
#
|
|
|
|
# script/version
|
|
|
|
# mas
|
|
|
|
#
|
2019-01-19 04:37:51 +00:00
|
|
|
# Displays the current marketing version of mas.
|
2019-01-13 07:18:35 +00:00
|
|
|
#
|
|
|
|
|
2020-05-12 03:02:25 +00:00
|
|
|
# This no longer works with MARKETING_VERSION build setting in Info.plist
|
|
|
|
# agvtool what-marketing-version -terse1
|
|
|
|
|
2024-09-30 15:28:25 +00:00
|
|
|
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
|
|
|
|
|
2021-04-29 05:51:33 +00:00
|
|
|
VERSION=$(git describe --abbrev=0 --tags)
|
|
|
|
VERSION=${VERSION#v}
|
2021-04-28 19:20:40 +00:00
|
|
|
|
2024-09-30 15:28:25 +00:00
|
|
|
cat <<EOF >"Sources/MasKit/Package.swift"
|
2021-04-28 19:20:40 +00:00
|
|
|
// Generated by: script/version
|
|
|
|
enum Package {
|
2021-05-08 20:26:25 +00:00
|
|
|
static let version = "${VERSION}"
|
2021-04-28 19:20:40 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2021-06-09 01:56:27 +00:00
|
|
|
echo "${VERSION}"
|