diff --git a/Cargo.toml b/Cargo.toml index df894c7..f95f826 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,3 +67,8 @@ test = false # no unit tests name = "elan-init" path = "src/elan-cli/main.rs" test = false # no unit tests + +[[bin]] +name = "elan" +path = "src/elan-cli/main.rs" +test = false # no unit tests diff --git a/README.md b/README.md index e8188b0..10f94ab 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,29 @@ On some systems, `lean`/`leanpkg` will not work out of the box even if installed *elan* is basically a fork of [rustup](https://github.com/rust-lang-nursery/rustup.rs). Apart from new features and adaptions to the Lean infrastructure, these are the basic changes to the original code: * Replaced every mention of `rustup` with `elan`, `cargo` with `leanpkg`, and `rust(c)` with `lean` -* Removed Windows installer... for now? * Merged `CARGO_HOME` and `RUSTUP_HOME` * Removed options to configure host triple + +# Build + +If you want to build elan from source, you will need to install [Rust](https://www.rust-lang.org/tools/install) and +Cargo and run the following: + +``` +cargo build +``` + +The built binaries will show up in `target/debug` folder. You can test that it works by running the following: + +``` +./target/debug/elan --help +``` + +# Build on Windows + +The windows build requires a 64bit developer command prompt and a windows version of `perl.exe` which you can download +from [https://strawberryperl.com/](https://strawberryperl.com/). Make sure this downloaded perl.exe is the first thing +in your PATH so that the build does not try and use `c:\Program Files\Git\usr\bin\perl.exe`. The git provided version of +perl doesn't work for some reason. + +Then you can run `cargo build` as shown above. diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index faf300a..428e5bf 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -209,7 +209,7 @@ pub fn cli() -> App<'static, 'static> { .help("Standard library API documentation")) .group(ArgGroup::with_name("page") .args(&["book", "std"])))*/; - + /*if cfg!(not(target_os = "windows")) { app = app .subcommand(SubCommand::with_name("man") @@ -221,7 +221,7 @@ pub fn cli() -> App<'static, 'static> { .long("toolchain") .takes_value(true))); }*/ - + app.subcommand(SubCommand::with_name("self") .about("Modify the elan installation") .setting(AppSettings::VersionlessSubcommands) diff --git a/src/elan-cli/self_update.rs b/src/elan-cli/self_update.rs index 3e38489..30886f9 100644 --- a/src/elan-cli/self_update.rs +++ b/src/elan-cli/self_update.rs @@ -245,16 +245,6 @@ pub fn install(no_prompt: bool, verbose: bool, if let Err(ref e) = install_res { common::report_error(e); - // On windows, where installation happens in a console - // that may have opened just for this purpose, give - // the user an opportunity to see the error before the - // window closes. - if cfg!(windows) && !no_prompt { - println!(""); - println!("Press the Enter key to continue."); - try!(common::read_line()); - } - process::exit(1); } @@ -729,7 +719,6 @@ fn delete_elan_and_elan_home() -> Result<()> { use winapi::shared::minwindef::DWORD; use std::os::windows::ffi::OsStrExt; use std::ptr; - use std::io; use std::mem; unsafe {