I’m attempting to install Homebrew in a Linux build by doing the below:
- name: Installing Homebrew run: | touch ~/.bash_profile ~/.profile /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >> ~/.bash_profile echo "eval \$($(brew --prefix)/bin/brew shellenv)" >> ~/.profile echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~/.bash_profile source ~/.profile brew --version - name: Verify Homebrew's Installation run: brew --version
But I get the following error:
line 1: brew: command not found
I did find out though if I run source ~/.profile && brew --version in the second step it does work. My question is, is there a way to have source ~/.profile retained between each step in a job? Is there a better way to go about doing this?