passepartout-apple/screenshots/compose-device.sh
Davide 6e8f10f919
Improve CI and local scripts (#1020)
- Move non-CI scripts to "scripts"
- Use lowercase variables consistently
- Work with relative paths
- Work with environment
- Parametrize Xcode build/version number (move uniq last)
2024-12-17 13:10:43 +01:00

54 lines
861 B
Bash
Executable File

#!/bin/bash
cwd=`dirname $0`
if [[ -z "$1" ]]; then
echo "Device required"
exit 1
fi
device=$1
cmd_compose="$cwd/compose.sh"
fastlane_screenshots_root="$cwd/../fastlane/screenshots"
case $device in
"iphone")
nums=("01 02 03 04 05")
template="main"
width=1242
height=2688
fastlane="iOS"
;;
"ipad")
nums=("01 02 03 04 05")
template="main"
width=2048
height=2732
fastlane="iOS"
;;
"mac")
nums=("01 02 03 04 05")
template="main"
width=2880
height=1800
fastlane="macOS"
;;
"appletv")
nums=("01 02 03")
template="tv"
width=3840
height=2160
fastlane="tvOS"
;;
*)
echo "Unknown device: $device"
exit 1
;;
esac
for num in $nums; do
$cmd_compose $template $device $num $width $height "$fastlane_screenshots_root/$fastlane/en-US"
done