From de4f59c442391d0efb6d433f6b41ba4d94fb38f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:16:20 +0000 Subject: [PATCH] Address PR review feedback - simplify validation and remove license display Co-authored-by: shivammathur <1571086+shivammathur@users.noreply.github.com> --- __tests__/tools.test.ts | 2 +- src/scripts/tools/mago.ps1 | 5 +---- src/scripts/tools/mago.sh | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index 07b6cb15..cacfca3a 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -500,7 +500,7 @@ describe('Tools tests', () => { 'Add-Tool https://deployer.org/deployer.phar deployer "-V"', 'Tool does_not_exist is not supported', 'Add-ComposerTool flex flex symfony/ global', - 'Add-Mago latest', + 'Add-Mago', 'Add-ComposerTool name-collision-detector name-collision-detector shipmonk/ scoped', 'Add-ComposerTool phinx phinx robmorgan/ scoped', 'Add-Tool https://github.com/phar-io/phive/releases/download/0.15.3/phive-0.15.3.phar phive "status"', diff --git a/src/scripts/tools/mago.ps1 b/src/scripts/tools/mago.ps1 index 8202cd9d..b28b452c 100644 --- a/src/scripts/tools/mago.ps1 +++ b/src/scripts/tools/mago.ps1 @@ -19,7 +19,7 @@ Function Get-MagoTag() { Function Add-Mago() { param( [Parameter(Mandatory = $true, Position = 0, HelpMessage = 'The mago version to be installed')] - [ValidatePattern('^latest$|^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')] + [ValidatePattern('^latest$|^\d+\.\d+\.\d+$')] [string] $mago_tag ) $mago_tag = Get-MagoTag @@ -33,7 +33,4 @@ Function Add-Mago() { Move-Item -Path $bin_dir\mago\mago.exe -Destination $bin_dir\mago.exe Add-ToProfile $current_profile 'mago' "New-Alias mago $bin_dir\mago.exe" Add-Log $tick "mago" "Added mago $mago_tag" - printf "$env:GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "mago" "Click to read the mago related license information" - Write-Output (Invoke-WebRequest https://raw.githubusercontent.com/carthage-software/mago/main/LICENSE).Content - Write-Output "$env:END_GROUP" } \ No newline at end of file diff --git a/src/scripts/tools/mago.sh b/src/scripts/tools/mago.sh index 60008b0b..655d2d25 100644 --- a/src/scripts/tools/mago.sh +++ b/src/scripts/tools/mago.sh @@ -26,7 +26,4 @@ add_mago() { sudo chmod +x /usr/local/bin/mago ) >/dev/null 2>&1 add_log "${tick:?}" "mago" "Added mago $mago_tag" - printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "mago" "Click to read the mago related license information" - curl "${curl_opts[@]:?}" https://raw.githubusercontent.com/carthage-software/mago/main/LICENSE - echo "$END_GROUP" } \ No newline at end of file