-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #479 from apollographql/abernix/guide-to-rust-install
Convey missing prerequisites, but don't try to install them.
- Loading branch information
Showing
4 changed files
with
45 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env node | ||
|
||
const { spawnSync } = require('child_process'); | ||
|
||
// Try to run rustup with the "version" (-V) flag, to smoke test whether | ||
// or not Rust is already installed. | ||
const result = | ||
spawnSync(process.platform === "win32" ? "rustup.exe" : "rustup", ["-V"]); | ||
|
||
// If this returns 0, then it is available! No need for additional work. | ||
// If it returns anything else (most likely `null`, since there's not much | ||
// else that can go wrong with the "version" command), then it's likely that | ||
// Rust isn't installed, or that the installation is otherwise broken. | ||
if (result.status === 0) { | ||
process.exit(0); | ||
} | ||
|
||
console.info("***************************************************************"); | ||
console.info("* Rustup needs to be installed to work with this repository *"); | ||
console.info("***************************************************************"); | ||
console.info(""); | ||
console.info("For information how to install it, visit:") | ||
console.info(""); | ||
console.info(" => https://rustup.rs/"); | ||
console.info(""); | ||
process.exit(1); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters