Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Fix test-in-docker #882

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions test-in-docker
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ err()
resolve_framework() {
local f=$1 found
found=${frameworks[(In:-1:)$f*]}
if (( found <= $#frameworks )); then
echo "${frameworks[$found]}"
if (( found <= ${#frameworks} )); then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't change anything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, force of habit as well. 😄

echo "${1}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're breaking the ability to find near matches.

For example the old code could handle zi and resolve it to zim. Your code will just crash trying to use docker//Dockerfile (the framework would be missing in the // part).

In addition, the old code would default to the first framework, if none was specified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it seems that sometime between ZSH 5.3 and 5.5 that this code broke. I'll look into it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah! Good point!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it in #884. If you could review it, that'd be nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do. And create a new PR with the new Dockerfiles on top of yours.

fi
}

Expand Down Expand Up @@ -162,7 +162,7 @@ while (( $# > 0 )); do
if [[ -z "$use_framework" ]]; then
local f="$(resolve_framework "$1")"
if [[ -n "$f" ]]; then
use_framework=$f
use_framework="${f}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't add anything. Both are identical; when assigning a variable from a variable, quoting isn't needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That was done by force of habit.. 🙄

else
err "No such framework '${1}'"
fi
Expand Down