File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ if [ "$(uname)" == "Darwin" ]; then
1414 eval " $( /opt/homebrew/bin/brew shellenv) "
1515 fi
1616elif [ " $( expr substr $( uname -s) 1 5) " == " Linux" ]; then
17- # Linux
17+ # Add homebrew to path if it's not already added
18+ if ! grep -q ' export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' ~ /.bashrc && ! grep -q ' export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' ~ /.zshrc; then
19+ if [ -n " $ZSH_VERSION " ]; then
20+ echo ' export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~ /.zshrc
21+ elif [ -n " $BASH_VERSION " ]; then
22+ echo ' export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~ /.bashrc
23+ fi
24+ fi
25+
26+ # Install snap if not installed
1827 if ! command -v snap & > /dev/null; then
1928 sudo apt-get update
2029 sudo apt-get install -y snapd
91100
92101
93102# Add flutter path to shell configuration
94- if ! grep -q ' export PATH="$HOME/fvm/default/bin"' $SHELL_CONFIG ; then
103+ if ! grep -q ' export PATH="$PATH":"$ HOME/fvm/default/bin"' $SHELL_CONFIG ; then
95104 if [ " $( uname) " == " Darwin" ]; then
96105 sed -i ' ' ' 1i\
97- export PATH="$HOME/fvm/default/bin"' $SHELL_CONFIG
106+ export PATH="$PATH":"$ HOME/fvm/default/bin"' $SHELL_CONFIG
98107 else
99- echo ' export PATH="$HOME/fvm/default/bin"' >> $SHELL_CONFIG
108+ echo ' export PATH="$PATH":"$ HOME/fvm/default/bin"' >> $SHELL_CONFIG
100109 fi
101110fi
102111
You can’t perform that action at this time.
0 commit comments