mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-05 00:01:20 +00:00
composer: allow options on selfupdate command (closes #2341)
Change pre/post_install to array
This commit is contained in:
parent
8d9d32cd4d
commit
f0f0427849
@ -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",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user