Skip to content

Commit

Permalink
fix: transform connector name to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
SamraatBansal committed Dec 4, 2023
1 parent 3ce04ab commit 3624eb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/add_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function find_prev_connector() {
eval "$2='aci'"
}

payment_gateway=$1;
payment_gateway=$(echo $1 | tr '[:upper:]' '[:lower:]')
base_url=$2;
payment_gateway_camelcase="$(tr '[:lower:]' '[:upper:]' <<< ${payment_gateway:0:1})${payment_gateway:1}"
src="crates/router/src"
Expand All @@ -49,7 +49,7 @@ git checkout $conn.rs $src/types/api.rs $src/configs/settings.rs config/developm

# Add enum for this connector in required places
previous_connector=''
find_prev_connector $1 previous_connector
find_prev_connector $payment_gateway previous_connector
previous_connector_camelcase="$(tr '[:lower:]' '[:upper:]' <<< ${previous_connector:0:1})${previous_connector:1}"
sed -i'' -e "s|pub mod $previous_connector;|pub mod $previous_connector;\npub mod ${payment_gateway};|" $conn.rs
sed -i'' -e "s/};/${payment_gateway}::${payment_gateway_camelcase},\n};/" $conn.rs
Expand Down

0 comments on commit 3624eb1

Please sign in to comment.