Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use "builtin type" to locate "mcfly"
The command "which" is a non-POSIX external command, and technically, its existence in the system is not ensured. We here use Bash's built-in command "type", which is the most reliable. We prefix "builtin" to "type" because some users overwrite "type" with a shell function or an alias to mimic Windows' "type" command. The use of the which command was first removed in Ref. [1]. However, this was reverted after the issue in Ref. [2]. As far as a relative path is not contained in PATH, the problem reported in Ref. [2] does not seem to be reproducible in all the versions from Bash 3.0 to 5.2 and in the devel branch of Bash. However, when the path "./bin" is included in PATH, the "command -v" produces the relative path "./bin/mcfly" as reported. This seems to have been solved by using the "which command in the reporter's environment, but the behavior of the "which" command may depend on the implementation. We should explicitly resolve the relative path if the obtained MCFLY_PATH is relative. References: [1] cantino#216 [2] cantino#292 [3] cantino#430 (comment)
- Loading branch information