We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 054b043 commit 7c38c85Copy full SHA for 7c38c85
update_models.sh
@@ -0,0 +1,25 @@
1
+#!/usr/bin/env bash
2
+
3
+# Script downloading the latest Apple devices and outputting an appledb-compatible JSON
4
5
+DEVICES_URL="https://gist.githubusercontent.com/adamawolf/3048717/raw/Apple_mobile_device_types.txt"
6
7
+REMOVE_KEYS="i386 x86_64 arm64"
8
9
+curl -s "$DEVICES_URL" \
10
+| jq -Rn --arg remove_keys "$REMOVE_KEYS" '
11
+ reduce inputs as $line ({};
12
+ if ($line | test(":")) then
13
+ . + {
14
+ ($line | split(":")[0] | gsub("^\\s+|\\s+$"; "")):
15
+ ($line | split(":")[1] | gsub("^\\s+|\\s+$"; ""))
16
+ }
17
+ else
18
+ .
19
+ end
20
+ )
21
+ | ( $remove_keys | split(" ") ) as $keys
22
+ | reduce $keys[] as $k (.;
23
+ del(.[$k])
24
25
+'
0 commit comments