Skip to content

Commit 3244639

Browse files
authored
Merge pull request #331 from lucienboland/fix-alt-bma_home-path
Fixed a few references to standard path so BMA_HOME will work instead
2 parents 0efd0c7 + 51fdfc0 commit 3244639

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,12 @@ a changes that would eliminate any shell compatibility problems without compromi
185185
the functionaility, simplicity and discoverability of the project. Massive thanks
186186
to [@ninth-dev](https://github.com/ninth-dev) for this.
187187

188+
```Shell
188189
# bash users may source the functions instead of loading the aliases
189-
if [ -d ${HOME}/.bash-my-aws ]; then
190-
for f in ~/.bash-my-aws/lib/*-functions; do source $f; done
190+
if [ -d ${BMA_HOME:-$HOME/.bash-my-aws} ]; then
191+
for f in ${BMA_HOME:-$HOME/.bash-my-aws}/lib/*-functions; do source $f; done
191192
fi
193+
```
192194

193195

194196
## Usage

bin/bma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414
# Assumes you have installed bash-my-aws to standard location
1515

16-
for f in ~/.bash-my-aws/lib/*-functions; do source $f; done
16+
for f in "${BMA_HOME:-$HOME/.bash-my-aws}"/lib/*-functions; do source $f; done
1717

1818
# Disable awcli client side pager
1919
#

docs/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,20 @@ As shown below, you may simply clone the GitHub repo and source the files requir
157157
(You should probably fork it instead to keep your customisations)
158158

159159
```Shell
160-
$ git clone https://github.com/bash-my-aws/bash-my-aws.git ~/.bash-my-aws
160+
$ git clone https://github.com/bash-my-aws/bash-my-aws.git ${BMA_HOME:-$HOME/.bash-my-aws}
161161
```
162162

163163
Put the following in your shell's startup file:
164164

165165
```Shell
166-
export PATH="$PATH:$HOME/.bash-my-aws/bin"
167-
source ~/.bash-my-aws/aliases
166+
export PATH="$PATH:${BMA_HOME:-$HOME/.bash-my-aws}/bin"
167+
source ${BMA_HOME:-$HOME/.bash-my-aws}/aliases
168168

169169
# For ZSH users, uncomment the following two lines:
170170
# autoload -U +X compinit && compinit
171171
# autoload -U +X bashcompinit && bashcompinit
172172

173-
source ~/.bash-my-aws/bash_completion.sh
173+
source ${BMA_HOME:-$HOME/.bash-my-aws}/bash_completion.sh
174174
```
175175

176176
!!! note "Why use shell aliases?"
@@ -184,11 +184,13 @@ source ~/.bash-my-aws/bash_completion.sh
184184
the functionaility, simplicity and discoverability of the project. Massive thanks
185185
to [@ninth-dev](https://github.com/ninth-dev) for this.
186186

187-
187+
```Shell
188188
# bash users may source the functions instead of loading the aliases
189-
if [ -d ${HOME}/.bash-my-aws ]; then
189+
if [ -d ${BMA_HOME:-$HOME/.bash-my-aws} ]; then
190+
for f in ${BMA_HOME:-$HOME/.bash-my-aws}/lib/*-functions; do source $f; done
190191
for f in ~/.bash-my-aws/lib/*-functions; do source $f; done
191192
fi
193+
```
192194

193195
## Usage
194196

test/exercise-functions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

3-
source ~/.bash-my-aws/bin/bma
3+
for f in ${BMA_HOME:-$HOME/.bash-my-aws}/lib/*-functions; do source $f; done
4+
source "${BMA_HOME:-$HOME/.bash-my-aws}"/bin/bma
45

56
# init function override for aws
67
function aws() {

0 commit comments

Comments
 (0)