Skip to content

Commit

Permalink
added quacks to make wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Nov 23, 2023
1 parent b0fd276 commit 49ccbd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opt/cs50/bin/make
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ $# -eq 1 ]] && [[ $1 != -* ]]; then

# If target is a directory
if [[ -d $1 ]]; then
echo "Cannot run ${bold}make${normal} on a directory. Did you mean to ${bold}cd${normal} into it first?"
echo "Quack. Cannot run ${bold}make${normal} on a directory. Did you mean to ${bold}cd${normal} into it first?"
exit 1
fi

Expand All @@ -22,7 +22,7 @@ if [[ $# -eq 1 ]] && [[ $1 != -* ]]; then
# If base is non-empty and not a directory
base="${1%.c}"
if [[ -n "$base" ]] && [[ ! -d "$base" ]]; then
echo "Did you mean ${bold}make ${base}${normal}?"
echo "Quack. Did you mean ${bold}make ${base}${normal}?"
exit 1
fi
fi
Expand All @@ -34,7 +34,7 @@ if [[ $# -eq 1 ]] && [[ $1 != -* ]]; then
# Search recursively for .c file
paths=$(find * -name "$c")
lines=$(echo "$paths" | wc -l)
echo -n "There isn't a file called ${bold}${c}${normal} in your current directory."
echo -n "Quack. There isn't a file called ${bold}${c}${normal} in your current directory."
if [[ "$lines" -eq 1 ]]; then # If unambiguous
d=$(dirname "$paths")
echo " Did you mean to ${bold}cd ${d}${normal} first?"
Expand Down

0 comments on commit 49ccbd9

Please sign in to comment.