Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux/bin/code.sh: use command -v instead of which #82097

Merged
merged 1 commit into from Oct 8, 2019

Conversation

@jplatte
Copy link
Contributor

commented Oct 8, 2019

command is a bash-builtin (see the Bash manual) that is guaranteed to always be present, in contrast to which, which is not required to be available for bash to work.

This dependency on which has recently caused an issue for a small percentage of arch linux users where VSCode wouldn't start anymore, see visual-studio-code-bin on the AUR. By removing the dependency, VSCode becomes a tiny bit more self-contained (unless it's still used somewhere else of course).

@Tyriar
Tyriar approved these changes Oct 8, 2019
Copy link
Member

left a comment

Good suggestion 👍

@Tyriar Tyriar added this to the October 2019 milestone Oct 8, 2019
@Tyriar Tyriar merged commit f0faef0 into microsoft:master Oct 8, 2019
1 of 2 checks passed
1 of 2 checks passed
VS Code #20191008.30 failed
Details
license/cla All CLA requirements met.
@eli-schwartz

This comment has been minimized.

Copy link

commented Oct 13, 2019

More generally, see https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then
See also https://mywiki.wooledge.org/BashFAQ/081

command -v is guaranteed to exist in any Bourne-like shell that is compliant with POSIX 2008 (in POSIX 2004 it was an optional component only required on systems with the User Portability option, but then it became required everywhere as of the decade-old 2008 standard). The which program isn't guaranteed to exist anywhere, although Debian's policy document requires it.

Thanks for doing your part to help get us one step closer to a world in which the "which" program is not used. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.