Skip to content

Commit

Permalink
composer: allow options on selfupdate command (closes #2341)
Browse files Browse the repository at this point in the history
Change pre/post_install to array
  • Loading branch information
r15ch13 committed Jun 28, 2018
1 parent a00565f commit e26f754
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bucket/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"COMPOSER_HOME": "$persist_dir\\home"
},
"env_add_path": "home\\vendor\\bin",
"pre_install": "
echo 'if($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
",
"post_install": "
$och = \"$env:APPDATA\\Composer\"
if(Test-Path $och) {
Write-Host -F yellow \"Moving old 'COMPOSER_HOME' to '$persist_dir\\home'\"
Move-Item -Force \"$och\\*\" \"$persist_dir\\home\"
Remove-Item -Force \"$och\"
}
",
"pre_install": [
"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"
],
"post_install": [
"$och = \"$env:APPDATA\\Composer\"",
"if(Test-Path $och) {",
"Write-Host -F yellow \"Moving old 'COMPOSER_HOME' to '$persist_dir\\home'\"",
"Move-Item -Force \"$och\\*\" \"$persist_dir\\home\"",
"Remove-Item -Force \"$och\"",
"}"
],
"suggest": {
"PHP": [
"php",
Expand Down

0 comments on commit e26f754

Please sign in to comment.