Closed cmaeder closed 8 years ago
See there http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script for a detailed discussion for why which
should be avoided.
We have incorporated trang
into our make install, however trang
is not a hard prerequisite, and thus we throw out a non-blocking error message here. I am not entirely sure how things work in the docker, but it might just be lmh setup --update
can't find type
in the docker but type trang
finds trang
on your local machine which shouldn't be a problem.
If we really want, we can list trang
as one of the dependencies when doing smh setup --update
inside the docker so that this error will disappear.
I wonder why I get Can't exec "type":
. Probably because type
is not a binary and not a perl builtin (only a shell builtin)!
The easiest solution is to simply remove this non-working test.
Also note that bash type trang
yields "bash: type: No such file or directory". So perl's shell invocation may not work as expected.
Hmm I don't think we should remove this trang
not found message though.
First the catcher only behaviors differently when we do an update in the docker.
Second we still want to have some kind of notifier to tell the users what is causing a potential make error during the installation, whenever they install this plugin locally, given trang
is not installed.
If we really have to remove the error catcher, what would be the motivation behind this other than it rises Can't exec "type":
in the docker?
I'm simply saying either correct or remove the test in Makefile.PL (line 14: type trang
) as it does not work under linux. I wonder why it works on MacOS (does it?).
no it does not.
But you should keep in mind that Makefile.PL
is generated
But you should keep in mind that Makefile.PL is generated
really? from what? (it is committed)
It works in my VM too.
Are you sure this is not machine specific?
This works in the same way for me, it does not work from perl! (perl seems to call "bash type trang" and that does not work.)
Although which
is not recommended for the bash shell, I believe it is the best choice for perl (assuming that which
is far more likely available than trang
).
Yes yes you are right. @cmaeder
Just fixed it. Thanks for the report : )
Whenever I run
lmh setup --update
I get the following error message:type trang
returns "trang ist /usr/bin/trang" on my machine.type
is a bash builtin command (trytype type
). Maybewhich
should be used.