-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #682 from chocolatey/nuget.commandline
(nuget.commandline) AU updater
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# [nuget.commandline](https://chocolatey.org/packages/nuget.commandline) | ||
|
||
NuGet is the package manager for the Microsoft development platforms including .NET. NuGet gives you access to thousands of packages from other developers on [nuget.org](http://nuget.org), and the NuGet tools let you create, share, and host packages of your own. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. --> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages --> | ||
<id>nuget.commandline</id> | ||
<title>Nuget.CommandLine</title> | ||
<version>0</version> | ||
<authors>Microsoft</authors> | ||
<owners>chocolatey, nuget-mirror</owners> | ||
<summary>NuGet is the package manager for the Microsoft development platforms</summary> | ||
<description>NuGet is the package manager for the Microsoft development platforms including .NET. NuGet gives you access to thousands of packages from other developers on [nuget.org](http://nuget.org), and the NuGet tools let you create, share, and host packages of your own. | ||
</description> | ||
<projectUrl>https://github.com/NuGet/NuGet.Client</projectUrl> | ||
<tags>nuget dot.net microsoft foss cross-platform</tags> | ||
<copyright>© .NET Foundation. All rights reserved.</copyright> | ||
<licenseUrl>https://raw.githubusercontent.com/NuGet/NuGet.Client/dev/LICENSE.txt</licenseUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<iconUrl>https://cdn.rawgit.com/majkinetor/chocolatey/master/nuget.commandline/icon.png</iconUrl> | ||
<docsUrl>https://docs.microsoft.com/en-us/nuget</docsUrl> | ||
<projectSourceUrl>https://github.com/NuGet/NuGet.Client</projectSourceUrl> | ||
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/nuget.commandline</packageSourceUrl> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import-module au | ||
. $PSScriptRoot\..\..\scripts\Set-DescriptionFromReadme.ps1 | ||
|
||
$packageName = 'NuGet.CommandLine' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
# Those might be useful for some other nuget packages | ||
|
||
# ".\tools\chocolateyInstall.ps1" = @{ | ||
# "(?i)(^\s*[$]packageName\s*=\s*)('.*')"= "`$1'$packageName'" | ||
# } | ||
# ".\tools\chocolateyUninstall.ps1" = @{ | ||
# "(?i)(^\s*[$]packageName\s*=\s*)('.*')"= "`$1'$packageName'" | ||
# } | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { | ||
Get-RemoteFiles -Purge -NoSuffix | ||
|
||
set-alias 7z $Env:chocolateyInstall\tools\7z.exe | ||
rm tools\*.exe | ||
7z e tools\*.nupkg NuGet.exe -r -otools | ||
rm tools\*.nupkg | ||
} | ||
|
||
function global:au_AfterUpdate { Set-DescriptionFromReadme -SkipFirst 2 } | ||
|
||
function global:au_GetLatest { | ||
$releases = "https://www.nuget.org/packages/$packageName" | ||
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing | ||
|
||
$url = $download_page.links | ? title -like '*this version*' | % href | ||
$version = $url -split '/' | select -last 1 | ||
@{ | ||
Version = $version | ||
Url32 = "https://api.nuget.org/packages/$($packageName.ToLower()).${version}.nupkg" | ||
} | ||
} | ||
|
||
update -ChecksumFor none |