composer: allow options on selfupdate command (closes #2341)

Change pre/post_install to array
This commit is contained in:
Richard Kuhnt 2018-06-28 19:56:02 +02:00
parent 8d9d32cd4d
commit f0f0427849

View File

@ -9,18 +9,18 @@
"COMPOSER_HOME": "$persist_dir\\home" "COMPOSER_HOME": "$persist_dir\\home"
}, },
"env_add_path": "home\\vendor\\bin", "env_add_path": "home\\vendor\\bin",
"pre_install": " "pre_install": [
echo 'if($args -eq \"selfupdate\" -or $args -eq \"self-update\") { & scoop update composer }' | out-file \"$dir\\composer.ps1\" "echo 'if($args.length -eq 1 -and ($args -eq \"selfupdate\" -or $args -eq \"self-update\")) { & scoop update composer }' | out-file \"$dir\\composer.ps1\"",
echo 'else { & php (join-path \"$psscriptroot\" \"composer.phar\") @args }' | out-file \"$dir\\composer.ps1\" -append "echo 'else { & php (join-path $psscriptroot \"composer.phar\") @args }' | out-file \"$dir\\composer.ps1\" -append"
", ],
"post_install": " "post_install": [
$och = \"$env:APPDATA\\Composer\" "$och = \"$env:APPDATA\\Composer\"",
if(Test-Path $och) { "if(Test-Path $och) {",
Write-Host -F yellow \"Moving old 'COMPOSER_HOME' to '$persist_dir\\home'\" "Write-Host -F yellow \"Moving old 'COMPOSER_HOME' to '$persist_dir\\home'\"",
Move-Item -Force \"$och\\*\" \"$persist_dir\\home\" "Move-Item -Force \"$och\\*\" \"$persist_dir\\home\"",
Remove-Item -Force \"$och\" "Remove-Item -Force \"$och\"",
} "}"
", ],
"suggest": { "suggest": {
"PHP": [ "PHP": [
"php", "php",