File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed
Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 6363 jq -r '.projects[] | "\(.id) \(.name)"' "$projects_file" | while read -r id name; do
6464 version=$(curl -s -H "X-Key: $token" "https://api.newreleases.io/v1/projects/$id/latest-release")
6565 version_data=$(echo "$version" | jq -r '.version // empty')
66+ date=$(echo "$version" | jq -r '.date // empty')
6667 if [ -n "$version_data" ]; then
67- jq --arg name "$name" --arg version "$version_data" \
68- '. += [{"name": $name, "version": $version}]' "$output_file" > "$output_file.tmp" && mv "$output_file.tmp" "$output_file"
68+ jq --arg name "$name" --arg version "$version_data" --arg date "$date" \
69+ '. += [{"name": $name, "version": $version, "date": $date }]' "$output_file" > "$output_file.tmp" && mv "$output_file.tmp" "$output_file"
6970 fi
7071 done
7172 ((page++))
Original file line number Diff line number Diff line change @@ -17,9 +17,8 @@ const getVersions = async () => {
1717 const versions : AppVersion [ ] = JSON . parse ( fileContent ) ;
1818
1919 const modifiedVersions = versions . map ( version => {
20- const nameParts = version . name . split ( '/' ) ;
21- let newName = nameParts [ nameParts . length - 1 ] ;
22- newName = newName . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ;
20+ let newName = version . name ;
21+ newName = newName . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 / ] / g, '' ) ;
2322 return { ...version , name : newName } ;
2423 } ) ;
2524
Original file line number Diff line number Diff line change @@ -95,7 +95,26 @@ function ScriptItem({
9595 < div > { versions . length === 0 ? ( < p > Loading versions...</ p > ) :
9696 ( < >
9797 < p className = "text-l text-foreground" > Version:</ p >
98- < p className = "text-l text-muted-foreground" > { versions . find ( ( v ) => v . name === item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ) ?. version || "No Version Information found" } </ p >
98+ < p className = "text-l text-muted-foreground" > { versions . find ( ( v ) =>
99+ v . name === item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ||
100+ v . name . includes ( item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ) ||
101+ v . name . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) === item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' )
102+
103+ ) ?. version || "No Version information found"
104+ } </ p >
105+ < p className = "text-l text-foreground" > Latest changes:</ p >
106+ < p className = "text-l text-muted-foreground" >
107+ { ( ( ) => {
108+ const matchedVersion = versions . find ( ( v ) =>
109+ v . name === item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ||
110+ v . name . includes ( item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) ) ||
111+ v . name . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) === item . slug . replace ( / [ ^ a - z 0 - 9 ] / g, '' )
112+ ) ;
113+ return matchedVersion ?. date ?
114+ extractDate ( matchedVersion . date as unknown as string ) :
115+ "No date information found"
116+ } ) ( ) }
117+ </ p >
99118 </ > )
100119 }
101120 </ div >
Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ export interface OperatingSystem {
6060export interface AppVersion {
6161 name : string ;
6262 version : string ;
63+ date : Date ;
6364}
You can’t perform that action at this time.
0 commit comments