Skip to content

Commit

Permalink
fix profiles and dependencies on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
dankmeme01 committed Jul 13, 2024
1 parent 5d03029 commit b13f2ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ fn find_index_dependency(dep: &Dependency, config: &Config) -> Result<Found, Str
1,
10,
config,
true,
false,
Some(dep.version.to_geode_string()),
)?;

Expand Down Expand Up @@ -248,7 +248,7 @@ pub fn check_dependencies(
let externals = externals
.into_iter()
.map(|ext|
// If the external is provided as name:version get those, otherwise
// If the external is provided as name:version get those, otherwise
// assume it's just the name
if ext.contains(':') {
let mut split = ext.split(':');
Expand Down
14 changes: 12 additions & 2 deletions src/util/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ pub struct OldConfig {
fn profile_platform_default() -> String {
if cfg!(target_os = "windows") {
"win".to_owned()
} else if cfg!(target_os = "macos") {
"mac".to_owned()
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
"mac-intel".to_owned()
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
"mac-arm".to_owned()
} else {
"win".to_owned()
}
Expand Down Expand Up @@ -294,6 +296,14 @@ impl Config {
}
};

// migrate old profiles from mac to mac-arm or mac-intel
output.profiles.iter_mut().for_each(|profile| {
let p = profile.get_mut();
if p.platform == "mac" {
p.platform = profile_platform_default();
}
});

output.save();

if output.profiles.is_empty() {
Expand Down

0 comments on commit b13f2ba

Please sign in to comment.