mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Refactor patch_brew in darwin.sh
This commit is contained in:
parent
454ef11759
commit
17fd1a694b
@ -119,9 +119,11 @@ link_libraries() {
|
|||||||
|
|
||||||
# Patch brew to overwrite packages.
|
# Patch brew to overwrite packages.
|
||||||
patch_brew() {
|
patch_brew() {
|
||||||
sudo sed -i '' "s/ keg.link(verbose: verbose?)/ keg.link(verbose: verbose?, overwrite: true)/" "$brew_repo"/Library/Homebrew/formula_installer.rb
|
formula_installer="$brew_repo"/Library/Homebrew/formula_installer.rb
|
||||||
|
code=" keg.link(verbose: verbose?"
|
||||||
|
sudo sed -i '' "s/$code)/$code, overwrite: true)/" "$formula_installer"
|
||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
trap "git -C $brew_repo stash >/dev/null 2>&1" exit
|
trap "sudo sed -i '' 's/$code, overwrite: true)/$code)/' $formula_installer" exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Helper function to update the dependencies.
|
# Helper function to update the dependencies.
|
||||||
|
Loading…
Reference in New Issue
Block a user