Fix: CLI Release & Profile Conflict (#3115)
* fix: cli release & profile conflict * remove: commented code
This commit is contained in:
1 parent
d53a631b5a
commit
f96a42a5b9
1 file changed
+17
-7
@@ -239,11 +239,25 @@ impl BuildRequest {
|
|||||||
// Set the target, profile and features that vary between the app and server builds
|
// Set the target, profile and features that vary between the app and server builds
|
||||||
if self.build.platform() == Platform::Server {
|
if self.build.platform() == Platform::Server {
|
||||||
cargo_args.push("--profile".to_string());
|
cargo_args.push("--profile".to_string());
|
||||||
cargo_args.push(self.build.server_profile.to_string());
|
match self.build.release {
|
||||||
|
true => cargo_args.push("release".to_string()),
|
||||||
|
false => cargo_args.push(self.build.server_profile.to_string()),
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
if let Some(custom_profile) = &self.build.profile {
|
// Add required profile flags. --release overrides any custom profiles.
|
||||||
|
let custom_profile = &self.build.profile.as_ref();
|
||||||
|
if custom_profile.is_some() || self.build.release {
|
||||||
cargo_args.push("--profile".to_string());
|
cargo_args.push("--profile".to_string());
|
||||||
cargo_args.push(custom_profile.to_string());
|
match self.build.release {
|
||||||
|
true => cargo_args.push("release".to_string()),
|
||||||
|
false => {
|
||||||
|
cargo_args.push(
|
||||||
|
custom_profile
|
||||||
|
.expect("custom_profile should have been checked by is_some")
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: use the right arch based on the current arch
|
// todo: use the right arch based on the current arch
|
||||||
@@ -269,10 +283,6 @@ impl BuildRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.build.release {
|
|
||||||
cargo_args.push("--release".to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.build.verbose {
|
if self.build.verbose {
|
||||||
cargo_args.push("--verbose".to_string());
|
cargo_args.push("--verbose".to_string());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user