Skip to content

Commit

Permalink
Cleanup changes to resolve ShellCheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
reidsunderland committed Oct 18, 2023
1 parent 66b1f88 commit 693d91b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bin/sr3_action_remove
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The git repo needs to be updated to match.
#

source sr3_utils
source "${BASH_SOURCE%/*}/sr3_utils"

MAIN_BRANCH="main"

Expand Down
2 changes: 1 addition & 1 deletion bin/sr3_remove
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

MAIN_BRANCH="main"
#MAIN_BRANCH="main"

YELLOW='\033[1;33m'
NORMAL='\033[0m'
Expand Down
2 changes: 1 addition & 1 deletion bin/sr3_ssh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

source sr3_utils
source "${BASH_SOURCE%/*}/sr3_utils"

if [[ $# == 0 ]]; then
echo '[ERROR] no destination given'
Expand Down
6 changes: 4 additions & 2 deletions bin/sr3_utils
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ function sr3_get_git_path_pump_name()
{
# git rev-parse --show-toplevel gives the path to the top of the Git repo
# Data pump name is the name of the next directory below
export git_tld=$(git rev-parse --show-toplevel)
git_tld=$(git rev-parse --show-toplevel)
export git_tld
ret=$?
if [ $ret != 0 ]; then
echo "[ERROR] $0 must be run within a Git repository."
exit $ret
fi
export pump_name=$(pwd -P | sed "s|$(git rev-parse --show-toplevel)||g" | cut -d '/' -f 2)
pump_name=$(pwd -P | sed "s|$(git rev-parse --show-toplevel)||g" | cut -d '/' -f 2)
export pump_name
if [ ${#pump_name} -le 0 ]; then
echo "[ERROR] Invalid data pump name. Are you in the correct directory?"
exit 20
Expand Down
7 changes: 3 additions & 4 deletions bin/sr3d
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
action="$1"

# Special cases for certain actions BEFORE running on nodes
if ([[ "$action" == "add" ]] || [[ "$action" == "convert" ]] || [[ "$action" == "foreground" ]] ||
[[ "$action" == "convert" ]] || [[ "$action" == "run" ]] ); then
if [[ "$action" == "add" ]] || [[ "$action" == "convert" ]] || [[ "$action" == "foreground" ]] || \
[[ "$action" == "convert" ]] || [[ "$action" == "run" ]] ; then
echo "Action ${action} is not supported with sr3d."
echo "https://github.com/MetPX/sr3_tools/issues/2"i
exit 1
Expand All @@ -12,7 +12,6 @@ fi
sr3r "sr3 $*"

# Special cases for certain actions AFTER running on nodes

if [[ "$action" == "remove" ]] ; then
sr3_action_remove $*
sr3_action_remove "$@"
fi
2 changes: 1 addition & 1 deletion bin/sr3r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

source sr3_utils
source "${BASH_SOURCE%/*}/sr3_utils"

if [[ $# == 0
|| ($# == 1 && "$1" == '-h')
Expand Down

0 comments on commit 693d91b

Please sign in to comment.