Skip to content

Commit

Permalink
Merge pull request #682 from chocolatey/nuget.commandline
Browse files Browse the repository at this point in the history
(nuget.commandline) AU updater
  • Loading branch information
majkinetor authored Apr 17, 2017
2 parents 591d73d + 414e2f0 commit cd8b20e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
3 changes: 3 additions & 0 deletions automatic/nuget.commandline/README.md
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.
27 changes: 27 additions & 0 deletions automatic/nuget.commandline/nuget.commandline.nuspec
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>
42 changes: 42 additions & 0 deletions automatic/nuget.commandline/update.ps1
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

0 comments on commit cd8b20e

Please sign in to comment.