mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-11 16:14:42 +07:00
Address PR review feedback - simplify validation and remove license display
Co-authored-by: shivammathur <1571086+shivammathur@users.noreply.github.com>
This commit is contained in:
@ -500,7 +500,7 @@ describe('Tools tests', () => {
|
|||||||
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||||
'Tool does_not_exist is not supported',
|
'Tool does_not_exist is not supported',
|
||||||
'Add-ComposerTool flex flex symfony/ global',
|
'Add-ComposerTool flex flex symfony/ global',
|
||||||
'Add-Mago latest',
|
'Add-Mago',
|
||||||
'Add-ComposerTool name-collision-detector name-collision-detector shipmonk/ scoped',
|
'Add-ComposerTool name-collision-detector name-collision-detector shipmonk/ scoped',
|
||||||
'Add-ComposerTool phinx phinx robmorgan/ 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"',
|
'Add-Tool https://github.com/phar-io/phive/releases/download/0.15.3/phive-0.15.3.phar phive "status"',
|
||||||
|
@ -19,7 +19,7 @@ Function Get-MagoTag() {
|
|||||||
Function Add-Mago() {
|
Function Add-Mago() {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'The mago version to be installed')]
|
[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
|
[string] $mago_tag
|
||||||
)
|
)
|
||||||
$mago_tag = Get-MagoTag
|
$mago_tag = Get-MagoTag
|
||||||
@ -33,7 +33,4 @@ Function Add-Mago() {
|
|||||||
Move-Item -Path $bin_dir\mago\mago.exe -Destination $bin_dir\mago.exe
|
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-ToProfile $current_profile 'mago' "New-Alias mago $bin_dir\mago.exe"
|
||||||
Add-Log $tick "mago" "Added mago $mago_tag"
|
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"
|
|
||||||
}
|
}
|
@ -26,7 +26,4 @@ add_mago() {
|
|||||||
sudo chmod +x /usr/local/bin/mago
|
sudo chmod +x /usr/local/bin/mago
|
||||||
) >/dev/null 2>&1
|
) >/dev/null 2>&1
|
||||||
add_log "${tick:?}" "mago" "Added mago $mago_tag"
|
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"
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user