Skip to content

Commit

Permalink
Fix NuGet API calls in install script (#287)
Browse files Browse the repository at this point in the history
* Fix NuGet API calls in install script

* Update for bash

* Update workload-install.sh
  • Loading branch information
davidxuang authored Nov 21, 2024
1 parent 809e252 commit 74bd664
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workload/scripts/workload-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function Get-LatestVersion([string]$Id) {
{
try
{
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$Id/index.json -UseBasicParsing | ConvertFrom-Json
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$($Id.ToLowerInvariant())/index.json -UseBasicParsing | ConvertFrom-Json
return $Response.versions | Select-Object -Last 1
}
catch {
Expand Down
2 changes: 1 addition & 1 deletion workload/scripts/workload-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function install_tizenworkload() {

# Check latest version of manifest.
if [[ "$MANIFEST_VERSION" == "<latest>" ]]; then
MANIFEST_VERSION=$(curl -s https://api.nuget.org/v3-flatcontainer/$MANIFEST_NAME/index.json | grep \" | tail -n 1 | tr -d '\r' | xargs)
MANIFEST_VERSION=$(curl -s https://api.nuget.org/v3-flatcontainer/${MANIFEST_NAME,,}/index.json | grep \" | tail -n 1 | tr -d '\r' | xargs)
if [ -n "$MANIFEST_VERSION" ] && echo "$MANIFEST_VERSION" | grep -q "BlobNotFound"; then
MANIFEST_VERSION=$(getLatestVersion "$MANIFEST_NAME")
if [[ -n $MANIFEST_VERSION ]]; then
Expand Down

0 comments on commit 74bd664

Please sign in to comment.