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

Various improvements #41

Merged
merged 6 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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