remindctl/scripts/generate-version.sh
2026-01-03 07:14:56 +01:00

38 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT=$(cd "$(dirname "$0")/.." && pwd)
source "$ROOT/version.env"
OUTPUT="$ROOT/Sources/remindctl/Version.swift"
PLIST_OUTPUT="$ROOT/Sources/remindctl/Resources/Info.plist"
mkdir -p "$(dirname "$OUTPUT")"
mkdir -p "$(dirname "$PLIST_OUTPUT")"
cat > "$OUTPUT" <<SWIFT
// Generated by scripts/generate-version.sh. Do not edit.
enum RemindctlVersion {
static let current = "${MARKETING_VERSION}"
}
SWIFT
cat > "$PLIST_OUTPUT" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.steipete.remindctl</string>
<key>CFBundleName</key>
<string>remindctl</string>
<key>CFBundleExecutable</key>
<string>remindctl</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MARKETING_VERSION}</string>
<key>CFBundleVersion</key>
<string>${MARKETING_VERSION}</string>
<key>NSRemindersUsageDescription</key>
<string>Manage your reminders from the terminal.</string>
</dict>
</plist>
PLIST