File tree Expand file tree Collapse file tree 1 file changed +27
-8
lines changed
Expand file tree Collapse file tree 1 file changed +27
-8
lines changed Original file line number Diff line number Diff line change 22
33output=$1
44tmp_file=$( mktemp)
5+ name=$( basename " $0 " )
56
6- if [ $# -eq 0 ]; then
7- echo " usage: $( basename " $0 " ) file ..."
8- exit 1
9- fi
7+ show_usage () {
8+ echo " usage: $name file ..."
9+ }
1010
11- xcrun simctl io booted recordVideo " $tmp_file "
11+ show_version () {
12+ echo " $name version 1.0.0"
13+ }
1214
13- ffmpeg -i " $tmp_file " -vf scale= " w=-1:h=480:force_original_aspect_ratio=decrease " -pix_fmt rgb24 -r 10 -f gif - \
14- | gifsicle --optimize=3 > " $output "
15+ xcrecord () {
16+ xcrun simctl io booted recordVideo " $tmp_file "
1517
16- rm -r " $tmp_file "
18+ ffmpeg -i " $tmp_file " -vf scale=" w=-1:h=480:force_original_aspect_ratio=decrease" -pix_fmt rgb24 -r 10 -f gif - \
19+ | gifsicle --optimize=3 > " $output "
20+
21+ rm -r " $tmp_file "
22+ }
23+
24+ case $1 in
25+ -v|--version|version)
26+ show_version
27+ exit
28+ ;;
29+ ?* )
30+ xcrecord
31+ ;;
32+ * )
33+ show_usage
34+ ;;
35+ esac
You can’t perform that action at this time.
0 commit comments