Skip to content

Commit

Permalink
Merge pull request #163 from sonos/use-package-name-instead-of-runnab…
Browse files Browse the repository at this point in the history
…le-id-for-dinghy-dir

Use package name instead of runnable id for dir on target
  • Loading branch information
fredszaq authored Jul 20, 2022
2 parents 8e005df + e21c2a1 commit 7971a88
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions cargo-dinghy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ fn run_command(cli: DinghyCli) -> Result<()> {
dynamic_libraries: vec![],
runnable: Runnable {
id: exe_id,
package_name: std::env::var("CARGO_PKG_NAME")?,
exe: PathBuf::from(exe).canonicalize()?,
// cargo launches the runner inside the dir of the crate
source: PathBuf::from(".").canonicalize()?,
Expand Down
4 changes: 2 additions & 2 deletions dinghy-lib/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pub fn make_remote_app_with_name(

let root_dir = build.target_path.join("dinghy");
let bundle_path = match bundle_name {
Some(name) => root_dir.join(&build.runnable.id).join(name),
None => root_dir.join(&build.runnable.id),
Some(name) => root_dir.join(&build.runnable.package_name).join(name),
None => root_dir.join(&build.runnable.package_name),
};
let bundle_libs_path = root_dir.join("overlay");
let bundle_target_path = &bundle_path;
Expand Down
1 change: 1 addition & 0 deletions dinghy-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ impl BuildBundle {
#[derive(Clone, Debug, Default)]
pub struct Runnable {
pub id: String,
pub package_name: String,
pub exe: path::PathBuf,
pub source: path::PathBuf,
}
2 changes: 1 addition & 1 deletion dinghy-lib/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Project {
if metadata.is_dir() {
rec_copy(file, dst, td.copy_git_ignored)?;
} else {
fs::copy(file, dst)?;
copy_and_sync_file(file, dst)?;
}
} else {
log::warn!(
Expand Down

0 comments on commit 7971a88

Please # to comment.