Created
January 26, 2016 21:44
-
-
Save steveklabnik/f86cba4da1dc9c5c68e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| use std::path::PathBuf; | |
| fn main() { | |
| let our_args: Vec<_> = std::env::args().collect(); | |
| let prog = PathBuf::from(&our_args[1]); | |
| let basename = prog.parent().expect(&format!("Not a file '{:?}'", prog)); | |
| let var = String::from("0install-runenv-") + basename.to_str().unwrap(); | |
| let json_str = std::env::var(&var).expect(&format!("Environment variable '{:?}' not set", var)); | |
| //let j = json::from_str(json_str).unwrap(); | |
| //let mut prog_args: ~[~str] = json_list_to_str_vector(&j); | |
| //prog_args += our_args.last(); | |
| //execv(prog_args); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment