Skip to content

Commit

Permalink
fix: Rename functions to avoid name collision
Browse files Browse the repository at this point in the history
Changed the names of functions that had identical names in different files to avoid name collisions and ensure unique identifiers across the codebase. This update improves code maintainability and reduces the risk of unintended behavior due to function name conflicts.
  • Loading branch information
hiroTochigi committed Jun 13, 2024
1 parent 4d42a20 commit d9430c7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ fi
case "$1" in
aws)
source $manageConfigPath/src/aws/load.sh
driver "${@:2}"
awsDriver "${@:2}"
;;
sshConfigManager)
source $manageConfigPath/src/utils/load.sh
driver "${@:2}"
configDriver "${@:2}"
;;
*)
echo "Error: Invalid command."
Expand Down
2 changes: 1 addition & 1 deletion src/aws/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awsUsage() {
exit 1
}

function driver() {
function awsDriver() {

# Check if at least one argument is provided
if [ $# -eq 0 ]; then
Expand Down
12 changes: 12 additions & 0 deletions src/aws/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ source $manageConfigPath/src/aws/dependencies/sshtunnelFunction.sh
source $manageConfigPath/src/aws/dependencies/reverseShell.sh
source $manageConfigPath/src/aws/dependencies/updateOrAppend.sh

source $manageConfigPath/src/utils/dependencies/config.sh
source $manageConfigPath/src/utils/dependencies/array.sh
source $manageConfigPath/src/utils/dependencies/read.sh
source $manageConfigPath/src/utils/dependencies/replace.sh
source $manageConfigPath/src/utils/dependencies/retrieve.sh

source $manageConfigPath/src/utils/create.sh
source $manageConfigPath/src/utils/update.sh
source $manageConfigPath/src/utils/delete.sh
source $manageConfigPath/src/utils/callUpdate.sh
source $manageConfigPath/src/utils/driver.sh

source $manageConfigPath/src/aws/init.sh
source $manageConfigPath/src/aws/delete.sh
source $manageConfigPath/src/aws/stop.sh
Expand Down
2 changes: 1 addition & 1 deletion src/utils/callUpdate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

function update(){
function updateSshConfigInterface(){
local host=$1
local newKey=$2
local newValue=$3
Expand Down
4 changes: 2 additions & 2 deletions src/utils/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function sshConfigManagerUsage() {
echo " -h, --help Show help information"
}

function driver() {
function configDriver() {

# Check if at least one argument is provided
if [ $# -eq 0 ]; then
Expand All @@ -28,7 +28,7 @@ function driver() {
createSshConfig "${@:2}"
;;
update)
update "${@:2}"
updateSshConfigInterface "${@:2}"
;;
delete)
deleteSshConfig "${@:2}"
Expand Down

0 comments on commit d9430c7

Please sign in to comment.