mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
🔨 Add version_bump script
Moved swift package manifest manipulation out of version script
This commit is contained in:
parent
80c85f5200
commit
67e678452f
2 changed files with 35 additions and 9 deletions
|
@ -16,12 +16,3 @@ else
|
|||
fi
|
||||
MAS_VERSION=${MAS_VERSION#v}
|
||||
echo "${MAS_VERSION}"
|
||||
|
||||
SCRIPT_PATH=$(dirname "$(which "$0")")
|
||||
|
||||
cat <<EOF >"${SCRIPT_PATH}/../Sources/MasKit/Package.swift"
|
||||
// Generated by: script/version
|
||||
enum Package {
|
||||
static let version = "${MAS_VERSION}"
|
||||
}
|
||||
EOF
|
||||
|
|
35
script/version_bump
Executable file
35
script/version_bump
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/version_bump
|
||||
# mas
|
||||
#
|
||||
# Increments the marketing version of mas.
|
||||
#
|
||||
|
||||
last_tag=$(script/version)
|
||||
echo "Last git tag: $last_tag"
|
||||
|
||||
# arg 1 - version tag
|
||||
if test -n "$1"; then
|
||||
# auto-increment
|
||||
MAS_VERSION=$1
|
||||
else
|
||||
next_tag=$last_tag
|
||||
MAS_VERSION=$next_tag
|
||||
fi
|
||||
|
||||
echo "MAS_VERSION: $MAS_VERSION"
|
||||
|
||||
# Write new version into swift package
|
||||
SCRIPT_PATH=$(dirname "$(which "$0")")
|
||||
PACKAGE_MANIFEST="${SCRIPT_PATH}/../Sources/MasKit/Package.swift"
|
||||
cat <<EOF >"${PACKAGE_MANIFEST}"
|
||||
// Generated by: script/version
|
||||
enum Package {
|
||||
static let version = "${MAS_VERSION}"
|
||||
}
|
||||
EOF
|
||||
|
||||
echo
|
||||
cat "${PACKAGE_MANIFEST}"
|
||||
|
Loading…
Reference in a new issue