Skip to content

Commit

Permalink
(gh-209) Fix CLOC Automatic Update
Browse files Browse the repository at this point in the history
The AU automatic update for the CLOC package was failing due to a
mismatch in the regular expression extracting the url. An empty URL was
being extracted which ensured that the version number was not able to be
extracted. The lack of the version number was breaking the update.

Corrected the URL extraction to provide a valid URL and ensure the
availability of the version number.

Merge pull request #210 from dgalbraith/bug/cloc-automatic-updates/gh-209

Fixes gh-209
  • Loading branch information
dgalbraith committed Jan 22, 2021
2 parents 48d23e1 + 95db54d commit 151d001
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions automatic/cloc/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ function global:au_SearchReplace {
function global:au_GetLatest {
$download_page = Invoke-WebRequest -UseBasicParsing -Uri $releases

$urls = $download_page.links | where-object href -match $reurl | select-object -expand href | foreach-object { $domain + $_ }
$url = $urls -match $re | select-object -first 1
$url = $download_page.links | where-object href -match $refile | select-object -first 1 -expand href | foreach-object { $domain + $_ }
$urlSegmentSize = $([System.Uri]$url).Segments.Length
$filename = $([System.Uri]$url).Segments[$urlSegmentSize - 1]

Expand Down

0 comments on commit 151d001

Please sign in to comment.