-
Notifications
You must be signed in to change notification settings - Fork 14
/
intellij_version_latest.sh
executable file
·60 lines (52 loc) · 1.22 KB
/
intellij_version_latest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
download_url='https://data.services.jetbrains.com/products/releases?latest=true&type=release'
query_utlimate_editions() {
curl -s "$download_url&code=IIU" | jq -r '
(
.IIU[] |
.version as $version |
.downloads.linux |
[
$version,
"Ultimate",
.checksumLink
]
) | @tsv'
}
query_community_editions() {
curl -s "$download_url&code=IIC" | jq -r '
(
.IIC[] |
.version as $version |
.downloads.linux |
[
$version,
"Community",
.checksumLink
]
) | @tsv'
}
query_versions() {
(
query_utlimate_editions
query_community_editions
) | sort -V
}
query_checksums() {
IFS=$'\t'
while read -r -a columns; do
local version="${columns[0]}"
local edition="${columns[1]}"
local checksum_url="${columns[2]}"
# Fetch the checksum using curl
local response
response="$(curl -s "$checksum_url")"
checksum="${response%% *}" # Extract the checksum part (everything before the first space)
# Output the Version, Edition, and Checksum as a tab-separated value
echo -e "${version}\t${edition}\t${checksum}"
done
}
(
echo 'Version Edition SHA256'
query_versions | query_checksums
) | column -t