Skip to content

Commit

Permalink
Merge pull request #41 from MegatonHammer/various-improvements
Browse files Browse the repository at this point in the history
Various improvements
  • Loading branch information
roblabla committed Apr 10, 2020
2 parents f493ff0 + a9b8732 commit 23045cf
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 132 deletions.
2 changes: 1 addition & 1 deletion src/bin/cargo-nro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fn main() {
let iter = cargo_metadata::parse_message_stream(command.stdout.unwrap());
for message in iter {
match message {
Ok(Message::CompilerArtifact(ref artifact)) if artifact.target.kind[0] == "bin" => {
Ok(Message::CompilerArtifact(ref artifact)) if artifact.target.kind.contains(&"bin".into()) || artifact.target.kind.contains(&"cdylib".into()) => {
// Find the artifact's source. This is not going to be pretty.
// For whatever reason, cargo thought it'd be a *great idea* to make file URLs use
// the non-standard "path+file:///" scheme, instead of, y'know, the ""file:///" everyone
Expand Down
8 changes: 6 additions & 2 deletions src/bin/linkle_clap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn create_kip(input_file: &str, npdm_file: &str, output_file: &str) -> Result<()
let mut option = OpenOptions::new();
let output_option = option.write(true).create(true).truncate(true);
output_option.open(output_file)?;

nxo.write_kip1(&mut output_option.open(output_file).map_err(|err| (err, output_file))?, &npdm).map_err(|err| (err, output_file))?;
Ok(())
}
Expand Down Expand Up @@ -187,7 +187,11 @@ fn create_romfs(input_directory: &Path, output_file: &Path) -> Result<(), linkle
}

fn print_keys(is_dev: bool, key_path: Option<&Path>) -> Result<(), linkle::error::Error> {
let keys = linkle::pki::Keys::new_retail(key_path).unwrap();
let keys = if is_dev {
linkle::pki::Keys::new_retail(key_path).unwrap()
} else {
linkle::pki::Keys::new_dev(key_path).unwrap()
};

keys.write(&mut std::io::stdout()).unwrap();
Ok(())
Expand Down
Loading

0 comments on commit 23045cf

Please sign in to comment.