Skip to content

Commit

Permalink
Address #18
Browse files Browse the repository at this point in the history
  • Loading branch information
StratusFearMe21 committed Jun 27, 2023
1 parent 3ead027 commit 7dfdafe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{bail, Context, Result};
use cargo_toml::Value;
use cargo_toml::{Product, Value};
use fs_extra::dir::CopyOptions;
use std::{
io::{Read, Write},
Expand Down Expand Up @@ -36,10 +36,12 @@ fn main() -> Result<()> {
std::env::set_current_dir("..").context("Cannot chdir into previous directory")?;
}

let meta = cargo_toml::Manifest::<Value>::from_slice(unsafe {
let mut meta = cargo_toml::Manifest::<Value>::from_slice(unsafe {
memmap::Mmap::map(&std::fs::File::open("Cargo.toml")?)?.as_ref()
})
.context("Cannot find Cargo.toml")?;
meta.complete_from_path(Path::new("."))
.context("Could not fill in the gaps in Cargo.toml")?;
let pkg = meta
.package
.context("Cannot load metadata from Cargo.toml")?;
Expand Down Expand Up @@ -119,6 +121,7 @@ fn main() -> Result<()> {
link_deps = false;
}

if meta.bin.is_empty() {}
for currentbin in meta.bin {
let name = currentbin.name.unwrap_or(pkg.name.clone());
let appdirpath = std::path::Path::new(&target_prefix).join(name.clone() + ".AppDir");
Expand Down

0 comments on commit 7dfdafe

Please sign in to comment.