Skip to content

Commit 42c9986

Browse files
committed
perf: add trailing slash
1 parent 5375849 commit 42c9986

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/renameSmogon.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ convert(){
7373
isGmax="gmax"
7474
fi
7575
if [ "$isGmax" ]; then
76-
speciesName=$(curl -sS "https://pokeapi.co/api/v2/pokemon-species/$id" | jq -r '.name')
77-
pokemonID=$(curl -sS "https://pokeapi.co/api/v2/pokemon/$speciesName-$isGmax" | jq -r '.id' 2>/dev/null)
76+
speciesName=$(curl -sS "https://pokeapi.co/api/v2/pokemon-species/$id/" | jq -r '.name')
77+
pokemonID=$(curl -sS "https://pokeapi.co/api/v2/pokemon/$speciesName-$isGmax/" | jq -r '.id' 2>/dev/null)
7878
if [ $? -ne 0 ]; then
7979
echo "[-] Pkmn $speciesName-$isGmax wasn't found in PokeAPI"
8080
else
@@ -87,7 +87,7 @@ convert(){
8787
if [ $? -ne 0 ] || [ "$pokemonName" == 'null' ]; then
8888
echo "[-] Form ${id}_${form} wasn't found in the JSON mapping"
8989
else
90-
pokemonID=$(curl -sS "https://pokeapi.co/api/v2/pokemon/$pokemonName" | jq -r '.id' 2>/dev/null)
90+
pokemonID=$(curl -sS "https://pokeapi.co/api/v2/pokemon/$pokemonName/" | jq -r '.id' 2>/dev/null)
9191
if [ $? -ne 0 ]; then
9292
echo "[-] Pkmn $pokemonName wasn't found in PokeAPI"
9393
else

0 commit comments

Comments
 (0)