Skip to content

Commit

Permalink
Merge branch 'add-small-functions' of github.com:treehouses/luftballo…
Browse files Browse the repository at this point in the history
…n into add-small-functions
  • Loading branch information
hiroTochigi committed Feb 8, 2024
2 parents 1e42576 + c504d0f commit 9873915
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aws/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BASE=/home/pi

function delete(){

balloonName=$1
balloonName=$(setBalloonName "$1")

if ! isBalloonNameValid "$balloonName"; then
echo "Please provide a valid balloon name"
Expand Down
7 changes: 7 additions & 0 deletions src/aws/dependencies/utilitiyFunction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ function waitForOutput(){
echo $result
}

setBalloonName() {
if [ -z "$1" ]; then
echo "luftballon"
else
echo "$1"
fi
}
2 changes: 1 addition & 1 deletion src/aws/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
BASE=/home/pi

function restart(){
balloonName=$1
balloonName=$(setBalloonName "$1")

if ! isBalloonNameValid "$balloonName"; then
echo "Please provide a valid balloon name"
Expand Down
2 changes: 1 addition & 1 deletion src/aws/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
BASE=/home/pi

function stop(){
balloonName=$1
balloonName=$(setBalloonName "$1")
if ! isBalloonNameValid "$balloonName"; then
echo "Please provide a valid balloon name"
exit 1
Expand Down

0 comments on commit 9873915

Please sign in to comment.