rust-lang / rust-installer

The Bourne shell installer used by Rust and Cargo
Apache License 2.0
60 stars 68 forks source link

Suppress cd output when determining src_dir #28

Closed hugoduncan closed 9 years ago

hugoduncan commented 9 years ago

On OS X, cd can output the new directory to stdout on success. This commit just redirects the output of cd to /dev/null.

This fixes a problem installing multirust on OS X.

rust-highfive commented 9 years ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

brson commented 9 years ago

Thanks! Do you mind adding a comment to the source indicating this is because 'cd' will something on OS X?

It's so hard to keep track of all the workarounds for platform-specific behavior in the shell :)

hugoduncan commented 9 years ago

Comment added. It seems to be a workaround for bash, which is used for /bin/sh on OS X.

brson commented 9 years ago

Thanks!