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

Fix build failure due to missing environment var #228

Merged
merged 1 commit into from Dec 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions build.rs
@@ -1,12 +1,10 @@



#[cfg(feature = "skeptic")]
mod gen_skeptic {
extern crate skeptic;

use std::io::prelude::*;
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;

/// skeptic templates look for `rust` after the opening code fences so writing
Expand Down Expand Up @@ -39,7 +37,7 @@ fn main() {{

fn generate_skeptic_tests(file: &str) -> String {
// Preprocess the readme to inject the skeptic template needed to to run the examples
let out_file_name = Path::new(env!("OUT_DIR")).join(file);
let out_file_name = Path::new(&env::var("OUT_DIR").unwrap()).join(file);
let mut contents = TEMPLATE.as_bytes().into();
File::open(file)
.and_then(|mut raw_file| raw_file.read_to_end(&mut contents))
Expand Down