Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Typo #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pokemonsay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ usage() {
}

# Where the pokemon are.
pokemon_path=`pwd`/cows
pokemon_path="$(pwd)/cows"

list_pokemon() {
echo "Pokémon available in '$pokemon_path/':"
echo
all_pokemon="$(find $pokemon_path -name "*.cow" | sort)"
echo "$all_pokemon" | while read pokemon; do
pokemon=${pokemon##*/}
pokemon=${pokemon%.cow}
echo $pokemon
pokemon="${pokemon##*/}"
pokemon="${pokemon%.cow}"
echo "$pokemon"
done
exit 0
}
Expand Down Expand Up @@ -108,15 +108,15 @@ fi

# Define which pokemon should be displayed.
if [ -n "$POKEMON_NAME" ]; then
pokemon_cow=$(find $pokemon_path -name "$POKEMON_NAME.cow")
pokemon_cow="$(find "$pokemon_path" -name "$POKEMON_NAME.cow")"
elif [ -n "$COW_FILE" ]; then
pokemon_cow="$COW_FILE"
else
pokemon_cow=$(find $pokemon_path -name "*.cow" | shuf -n1)
pokemon_cow="$(find "$pokemon_path" -name "*.cow" | shuf -n1)"
fi

# Get the pokemon name.
filename=$(basename "$pokemon_cow")
filename="$(basename "$pokemon_cow")"
pokemon_name="${filename%.*}"

# Call cowsay or cowthink.
Expand All @@ -128,5 +128,5 @@ fi

# Write the pokemon name, unless requested otherwise.
if [ -z "$DISPLAY_NAME" ]; then
echo $pokemon_name
echo "$pokemon_name"
fi
4 changes: 2 additions & 2 deletions scrap_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

bulbapedia_page_url="http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Kanto_Pok%C3%A9dex_number"
bulbapedia_page_name="bulbapedia.html"
scrap_folder="`pwd`/scrapped-data"
scrap_folder="$(pwd)/scrapped-data"

# Make sure the directory for the scrapped data is there.
mkdir -p "$scrap_folder"
Expand All @@ -18,7 +18,7 @@ if [ ! -e "scrapped-data/bulbapedia.html" ]; then
echo " > Downloaded."
fi

# Dear furure me,
# Dear future me,
#
# If you are in need to maintain this part of the code... I am
# realy sorry for you (T.T). This was the best I could do... But
Expand Down