Use os::getcwd instead of env in rustbook (fixup #22727)
This commit is contained in:
parent
f8e4fcb38c
commit
9f8a1cb38d
3 changed files with 6 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
|||
//! Implementation of the `build` subcommand, used to compile a book.
|
||||
|
||||
use std::env;
|
||||
use std::os;
|
||||
use std::old_io;
|
||||
use std::old_io::{fs, File, BufferedWriter, TempDir, IoResult};
|
||||
|
||||
|
@ -81,7 +82,7 @@ fn render(book: &Book, tgt: &Path) -> CliResult<()> {
|
|||
|
||||
let src;
|
||||
if env::args().len() < 3 {
|
||||
src = env::current_dir().unwrap().clone();
|
||||
src = os::getcwd().unwrap().clone();
|
||||
} else {
|
||||
src = Path::new(env::args().nth(2).unwrap().clone());
|
||||
}
|
||||
|
@ -149,7 +150,7 @@ impl Subcommand for Build {
|
|||
}
|
||||
fn usage(&self) {}
|
||||
fn execute(&mut self, term: &mut Term) -> CommandResult<()> {
|
||||
let cwd = env::current_dir().unwrap();
|
||||
let cwd = os::getcwd().unwrap();
|
||||
let src;
|
||||
let tgt;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#![feature(core)]
|
||||
#![feature(old_io)]
|
||||
#![feature(env)]
|
||||
#![feature(os)]
|
||||
#![feature(old_path)]
|
||||
#![feature(rustdoc)]
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use error::Error;
|
|||
use term::Term;
|
||||
use book;
|
||||
use std::old_io::{Command, File};
|
||||
use std::env;
|
||||
use std::os;
|
||||
|
||||
struct Test;
|
||||
|
||||
|
@ -35,7 +35,7 @@ impl Subcommand for Test {
|
|||
}
|
||||
fn usage(&self) {}
|
||||
fn execute(&mut self, term: &mut Term) -> CommandResult<()> {
|
||||
let cwd = env::current_dir().unwrap();
|
||||
let cwd = os::getcwd().unwrap();
|
||||
let src = cwd.clone();
|
||||
|
||||
let summary = File::open(&src.join("SUMMARY.md"));
|
||||
|
|
Loading…
Add table
Reference in a new issue