mirror of
https://github.com/wavetermdev/chocolatey.git
synced 2026-08-05 13:47:23 -07:00
AU command
This commit is contained in:
@@ -27,9 +27,32 @@ In a package directory run: `Test-Package`.
|
||||
|
||||
## Automatic package update
|
||||
|
||||
Run `<package_dir>/update.ps1` from within the directory of the package to update that package. If this script is missing, the package is not automatic.
|
||||
### Single package
|
||||
|
||||
You can also call AU method `Update-AUPackages` (alias `updateall`) in the repository root. This will just update each package without any other action.
|
||||
Run from within the directory of the package to update that package:
|
||||
|
||||
cd <package_dir>
|
||||
./update.ps1
|
||||
|
||||
If this script is missing, the package is not automatic. Set `$au_Force = $true` prior to script call to update the package even if no new version is found.
|
||||
|
||||
### Multiple packages
|
||||
|
||||
To update all packages run `./update_all.ps1`. It accepts few options:
|
||||
|
||||
./update_all.ps1 -Name a* #Update all packages which name start with letter 'a'
|
||||
./update_all.ps1 -ForcedPackages 'cpu-z copyq' #Update all packages and force cpu-z and copyq
|
||||
./update_all.ps1 -ForcedPackages 'copyq:1.2.3' #Update all packages but force copyq and use explicit version
|
||||
./update_all.ps1 -Root 'c:\packages' #Update all packages in the c:\packages folder
|
||||
|
||||
The following global variables influence the execution of `update_all.ps1` script if set prior to the call:
|
||||
|
||||
$au_NoPlugins = $true #Do not execute plugins
|
||||
$au_Push = $false #Do not push to chocolatey
|
||||
|
||||
You can also call AU method `Update-AUPackages` (alias `updateall`) in the repository root. This will just update each package without any other action. For example to force update of all packages with a single command execute:
|
||||
|
||||
updateall -Options ([ordered]@{ Force = $true })
|
||||
|
||||
## Start using AU with your own packages
|
||||
|
||||
|
||||
+9
-5
@@ -22,9 +22,9 @@ $Options = [ordered]@{
|
||||
}
|
||||
|
||||
Gist = @{
|
||||
Id = $Env:gist_id #Your gist id or leave empty for anonymous
|
||||
ApiKey = $Env:github_api_key #Your github api key
|
||||
Path = "$PSScriptRoot\Update-AUPackages.md" #List of files to add to gist
|
||||
Id = $Env:gist_id #Your gist id; leave empty for new private or anonymous gist
|
||||
ApiKey = $Env:github_api_key #Your github api key - if empty anoymous gist is created
|
||||
Path = "$PSScriptRoot\Update-AUPackages.md" #List of files to add to the gist
|
||||
}
|
||||
|
||||
#Git = @{
|
||||
@@ -54,11 +54,15 @@ $Options = [ordered]@{
|
||||
ForcedPackages = $ForcedPackages -split ' '
|
||||
BeforeEach = {
|
||||
param($PackageName, $Options )
|
||||
if ($Options.ForcedPackages -contains $PackageName) { $global:au_Force = $true }
|
||||
$p = $Options.ForcedPackages | ? { $_ -match "^${PackageName}(?:\:(.+))$" }
|
||||
if (!$p) { return }
|
||||
|
||||
$global:au_Force = $true
|
||||
$global:au_Version = ($p -split ':')[1]
|
||||
}
|
||||
}
|
||||
|
||||
if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" }
|
||||
if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" }
|
||||
$global:au_Root = $Root #Path to the AU packages
|
||||
$info = updateall -Name $Name -Options $Options
|
||||
|
||||
|
||||
Reference in New Issue
Block a user