-
Notifications
You must be signed in to change notification settings - Fork 946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,7 +9,7 @@ for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do | |||
ln -nsf "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" | |||
done | |||
|
|||
ln -s "${HOME}/p9k/powerlevel9k.zsh-theme" \ | |||
ln -sf "${HOME}/p9k/powerlevel9k.zsh-theme" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use -f
without -n
. -n
prevents ln
from following symlinks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bigger deal with symlinks to directories. Without the -n
you build loops and other fun things.
@@ -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}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.. 🙄
if (( found <= $#frameworks )); then | ||
echo "${frameworks[$found]}" | ||
if (( found <= ${#frameworks} )); then | ||
echo "${1}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah! Good point!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 😄
Closed in favor of #884 |
This fixes the
test-in-docker
script and adds more recent ZSH versions (5.3.1 from Debian; rest is from Ubuntu).//cc @docwhat