mirror of
https://github.com/mas-cli/mas
synced 2024-11-25 13:00:23 +00:00
3eaffa5c3e
Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
29 lines
614 B
Bash
Executable file
29 lines
614 B
Bash
Executable file
#!/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 <<EOF >"Sources/mas/Package.swift"
|
|
/// Generated by \`script/version\`.
|
|
enum Package {
|
|
static let version = "${VERSION}"
|
|
}
|
|
EOF
|
|
|
|
echo "${VERSION}"
|