mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:59:42 +00:00
- Added support for registry-based dependencies in the dependencies section. - Updated the package section to include a project type field. - Introduced a new CLI command `dcr setup` to load and display registry configurations. - Implemented a new module for handling registry operations, including loading and resolving packages from registries. - Enhanced the build process to handle library packaging, including copying headers and libraries to the appropriate target directories. - Updated the CLI to support building library packages and added tests for library package builds. - Improved error handling and output messages during dependency resolution and package fetching.
22 lines
660 B
Rust
22 lines
660 B
Rust
use crate::platform;
|
|
use std::path::Path;
|
|
use std::process::Command;
|
|
|
|
pub fn run_binary(project_name: &str, profile: &str, target_dir: Option<&str>) -> i32 {
|
|
let bin_path = platform::bin_path(profile, project_name, target_dir);
|
|
if Path::new(&bin_path).exists() {
|
|
let output = Command::new(&bin_path).output();
|
|
match output {
|
|
Ok(o) => {
|
|
print!("{}", String::from_utf8_lossy(&o.stdout));
|
|
eprint!("{}", String::from_utf8_lossy(&o.stderr));
|
|
return o.status.code().unwrap_or(0);
|
|
}
|
|
Err(_) => {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
1
|
|
}
|