Skip to content

Commit

Permalink
script refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed May 27, 2021
1 parent d4354e3 commit fa7ad3f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 16 deletions.
8 changes: 7 additions & 1 deletion scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down
8 changes: 7 additions & 1 deletion scripts/collectGarbage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/install-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/register-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

Expand Down
8 changes: 7 additions & 1 deletion scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions scripts/start-on.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE
./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone {$STONE} does NOT exist"
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions scripts/stop-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE
./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
Expand Down
6 changes: 3 additions & 3 deletions scripts/stop-on.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE
./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone {$STONE} does NOT exist"
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions scripts/unregister-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ IS_STONE_DEFINED=$(isStoneNameAndVersionDefined)

if [ $IS_STONE_DEFINED = 0 ]; then
error "STONE_NAME AND VERSION are not defined"
print_actions "execute ./workwith -s STONE_NAME -v VERSION"
print_actions "execute . workwith -s STONE_NAME -v VERSION"
exit 1
fi

./checkIfStoneExist.sh $STONE
./checkIfStoneExist.sh $STONE_NAME
if [ $? -ne 0 ]; then
error "The Stone {$STONE} does NOT exist"
error "The Stone ${STONE_NAME} does NOT exist"
exit 1
fi

Expand Down

0 comments on commit fa7ad3f

Please sign in to comment.