Skip to content

Commit

Permalink
Fix newline symbol and rc version errors
Browse files Browse the repository at this point in the history
Signed-off-by: ghosind <ghosind@gmail.com>
  • Loading branch information
ghosind committed Nov 26, 2024
1 parent 1dad8e2 commit e56c29e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1534,15 +1534,17 @@ export DVM_VERSION="v0.9.1"
dvm_get_remote_versions() {
local last_version
local cache_file
local unstables
local unstable_versions

if [ -f "$DVM_DIR/unstable-versions" ] && dvm_get_versions_from_deno_versions_json
then
unstables=$(cat "$DVM_DIR/unstable-versions")
DVM_REMOTE_VERSIONS="$unstables\n$DVM_REMOTE_VERSIONS"
unstable_versions=$(cat "$DVM_DIR/unstable-versions")
DVM_REMOTE_VERSIONS=$(echo -e "$unstable_versions\n$DVM_REMOTE_VERSIONS")
return
fi

dvm_debug "Failed to get unstable versions from deno.com/versions.json, fallback to GitHub API"

cache_file="$DVM_DIR/cache/remote-versions"

if [ ! -d "$DVM_DIR/cache" ]
Expand Down Expand Up @@ -1607,7 +1609,7 @@ export DVM_VERSION="v0.9.1"
fi

versions=${DVM_REQUEST_RESPONSE#*cli}
DVM_REMOTE_VERSIONS=$(echo "$versions" | sed 's/"/\n/g' | grep -E "v[0-9]+\.[0-9]+\.[0-9]+" | sort -V)
DVM_REMOTE_VERSIONS=$(echo "$versions" | sed 's/"/\n/g' | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -V)
}

# Call GitHub API to getting all versions (release tag names) from the
Expand Down

0 comments on commit e56c29e

Please # to comment.