mirror of
https://github.com/mas-cli/mas
synced 2024-11-24 20:43:10 +00:00
8306c6eb2c
Obtain version & revision from most recent version tag in the current branch, not from environment variable or argument. Do not branch or commit on release. Partial #638 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
22 lines
515 B
Bash
Executable file
22 lines
515 B
Bash
Executable file
#!/bin/bash -eu
|
|
#
|
|
# script/generate_version_info_for_swift
|
|
# mas
|
|
#
|
|
# Generates a file to provide the mas version to Swift code.
|
|
#
|
|
|
|
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
|
|
|
|
# Write version to Swift singleton
|
|
cat <<EOF >Sources/mas/Package.swift
|
|
/// Generated by \`script/generate_version_info_for_swift\`.
|
|
enum Package {
|
|
static let version = "$(script/version)"
|
|
}
|
|
EOF
|