passepartout-apple/scripts/bump.sh
Davide 8972d9773e
Resolve several issues in bump script/lane (#1075)
- Simplify build/version updates by moving MARKETING_VERSION and
CURRENT_PROJECT_VERSION to Config.xcconfig
- Provide Ruby (for fastlane) and Bash (for CI) versions of
xconfig-get/set
- Copy release notes atomically inside the lane to guarantee they are
included in the version commit
- Add -nt to skip the build tag
2025-01-18 18:13:54 +01:00

74 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
positional_args=()
while [[ $# -gt 0 ]]; do
case $1 in
-v)
opt_version="version:$2"
shift # past argument
shift # past value
;;
-b)
opt_build="build:$2"
shift # past argument
shift # past value
;;
-s)
opt_since="since:$2"
shift # past argument
shift # past value
;;
-na)
opt_no_api=1
shift # past argument
;;
-nl)
opt_no_log="no_log:true"
shift # past argument
;;
-nt)
opt_no_tag="no_tag:true"
shift
;;
-d)
opt_dry_run=1
shift # past argument
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
positional_args+=("$1") # save positional arg
shift # past argument
;;
esac
done
set -- "${positional_args[@]}" # restore positional parameters
cwd=`dirname $0`
cmd_api="$cwd/update-bundled-api.sh"
cmd_fastlane="cd $cwd/.. && bundle exec fastlane bump $opt_version $opt_build $opt_since $opt_no_log $opt_no_tag"
if [[ -n $opt_dry_run ]]; then
echo "version = $opt_version"
echo "build = $opt_build"
echo "since = $opt_since"
echo "no_api = $opt_no_api"
echo "no_log = $opt_no_log"
echo "no_tag = $opt_no_tag"
if [[ -z $opt_no_api ]]; then
echo "$cmd_api"
fi
echo "$cmd_fastlane"
exit 0
fi
if [[ -z $opt_no_api ]]; then
eval "$cmd_api"
fi
eval "$cmd_fastlane"