From 39ebf256259e8cac228ea606aa8c1257a9db0c5a Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Wed, 10 Jan 2024 22:49:11 -0600 Subject: [PATCH] (#45) Replace au references with chocolatey-au where appropriate --- .appveyor.yml | 4 +--- README.md | 8 ++------ automatic/README.md | 10 +++++----- setup/README.md | 12 ++++++------ setup/au_setup.ps1 | 18 +++++++----------- update_all.ps1 | 2 -- 6 files changed, 21 insertions(+), 33 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 59c6d96de3..9e4bb01204 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,3 @@ -# AU template: https://github.com/majkinetor/au-packages-template - version: '{build}' max_jobs: 1 image: WMF 5 @@ -54,7 +52,7 @@ install: - ps: $PSVersionTable - git --version - ps: | - git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au + git clone -q https://github.com/chocolatey-community/chocolatey-au.git $Env:TEMP/au . "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version - ps: | diff --git a/README.md b/README.md index 0d99480ba7..ea9abb4dd8 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,10 @@ This contains Chocolatey packages, both manually and automatically maintained. ### Folder Structure -* automatic - where automatic packaging and packages are kept. These are packages that are automatically maintained using [AU](https://chocolatey.org/packages/au). +* automatic - where automatic packaging and packages are kept. These are packages that are automatically maintained using [chocolatey-au](https://github.com/chocolatey-community/chocolatey-au). * icons - Where you keep icon files for the packages. This is done to reduce issues when packages themselves move around. * manual - where packages that are not automatic are kept. -For setting up your own automatic package repository, please see [Automatic Packaging](https://chocolatey.org/docs/automatic-packages) - ### Requirements * Chocolatey (choco.exe) @@ -28,9 +26,7 @@ For setting up your own automatic package repository, please see [Automatic Pack #### AU * PowerShell v5+. -* The [AU module](https://chocolatey.org/packages/au). - -For daily operations check out the AU packages [template README](https://github.com/majkinetor/au-packages-template/blob/master/README.md). +* The [chocolatey-au module](https://github.com/chocolatey-community/chocolatey-au). ### Getting started diff --git a/automatic/README.md b/automatic/README.md index a181bda79f..5f6de0cb53 100644 --- a/automatic/README.md +++ b/automatic/README.md @@ -1,12 +1,12 @@ ## Automatic Folder -This is where you put your Chocolatey packages that are automatically packaged up by [AU](https://chocolatey.org/packages/au). +This is where you put your Chocolatey packages that are automatically packaged up by [chocolatey-au](https://github.com/chocolatey-community/chocolatey-au). -Execute `update_all.ps1` in the repository root to run [AU](https://chocolatey.org/packages/au) updater with default options. +Execute `update_all.ps1` in the repository root to run [chocolatey-au](https://github.com/chocolatey-community/chocolatey-au) updater with default options. -To fully setup all the features ensure you perform the steps in the [setup/README.md](https://github.com/chocolatey/chocolatey-packages-template/blob/master/setup/README.md#automatic-updater-au) +To fully setup all the features ensure you perform the steps in the [setup/README.md](https://github.com/chocolatey/chocolatey-packages-template/blob/master/setup/README.md) -To get the packages that implement AU updater run `Get-AUPackages` or `lsau` in this directory. +To get the packages that implement chocolatey-au updater run `Get-AUPackages` or `lsau` in this directory. -**NOTE:** Ensure when you are creating packages for AU, you don't use `--auto` as the packaging files should be normal packages. AU doesn't need the tokens to do replacement. +**NOTE:** Ensure when you are creating packages for chocolatey-au, you don't use `--auto` as the packaging files should be normal packages. chocolatey-au doesn't need the tokens to do replacement. diff --git a/setup/README.md b/setup/README.md index 42753be852..94e7f924f2 100644 --- a/setup/README.md +++ b/setup/README.md @@ -1,9 +1,9 @@ -# Setup Automatic Updater (AU) +# Setup Automatic Updater (chocolatey-au) -* Ensure you have the [Chocolatey PowerShell profile](https://chocolatey.org/docs/troubleshooting#why-does-choco-intab-not-work-for-me) installed. +* Ensure you have the [Chocolatey PowerShell profile](https://docs.chocolatey.org/en-us/troubleshooting#why-does-choco-tab-not-work-for-me) installed. * Open `au_setup.ps1` in an editor and review it. -* Run PowerShell `5.x` as Administrator (AU framework supports PowerShell 6+ but this setup does not) +* Run PowerShell `5.x` as Administrator (chocolatey-au framework supports PowerShell 6+ but this setup does not). * Run `au_setup.ps1`. -* Configure AU [plugins](https://github.com/majkinetor/au/blob/master/Plugins.md). -* Configure [AppVeyor](https://github.com/majkinetor/au/wiki/AppVeyor). -* Configure [local run](https://github.com/majkinetor/au/wiki#local-run). +* Configure chocolatey-au [plugins](https://github.com/chocolatey-community/chocolatey-au/blob/master/Plugins.md). +* Configure [AppVeyor](https://github.com/chocolatey-community/chocolatey-au/wiki/AppVeyor). +* Configure [local run](https://github.com/chocolatey-community/chocolatey-au/wiki#local-run). diff --git a/setup/au_setup.ps1 b/setup/au_setup.ps1 index 1725e6a68a..69dbd2ef33 100644 --- a/setup/au_setup.ps1 +++ b/setup/au_setup.ps1 @@ -1,17 +1,13 @@ -# WMF 3/4 only +# upgrade powershell if ($PSVersionTable.PSVersion -lt $(New-Object System.Version("5.0.0.0"))) { - choco install dotnet4.5.1 -y - choco upgrade powershell-packagemanagement --ignore-dependencies -y + choco install powershell -y } -$refreshenv = Get-Command refreshenv -ea SilentlyContinue -if ($refreshenv -ne $null -and $refreshenv.CommandType -ne 'Application') { - refreshenv # You need the Chocolatey profile installed for this to work properly (Choco v0.9.10.0+). +$UpdateSessionEnvironment = Get-Command Update-SessionEnvironment -ea SilentlyContinue +if ($UpdateSessionEnvironment -ne $null -and $UpdateSessionEnvironment.CommandType -ne 'Application') { + Update-SessionEnvironment # You need the Chocolatey profile installed for this to work properly (Choco v0.9.10.0+). } else { - Write-Warning "We detected that you do not have the Chocolatey PowerShell profile installed, which is necessary for 'refreshenv' to work in PowerShell." + Write-Warning "We detected that you do not have the Chocolatey PowerShell profile installed, which is necessary for 'Update-SessionEnvironment' to work in PowerShell." } -Install-PackageProvider -Name NuGet -Force -Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Install-Module au -Scope AllUsers -Get-Module au -ListAvailable | select Name, Version +choco install chocolatey-au -y diff --git a/update_all.ps1 b/update_all.ps1 index 9058a87b8e..840f9c5dc8 100644 --- a/update_all.ps1 +++ b/update_all.ps1 @@ -1,5 +1,3 @@ -# AU Packages Template: https://github.com/majkinetor/au-packages-template - param([string] $Name, [string] $ForcedPackages, [string] $Root = "$PSScriptRoot\automatic") if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }