Skip to content

Commit

Permalink
Flip build config merge direction (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden authored Jan 15, 2024
1 parent c8329a1 commit cc5d4ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Unreleased
==========

- Fix merging of `extra_options` configuration in `build` section
- Fix merging priority of `build` section options

0.5.1 (2023-04-16)
==================
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct BuildConfiguration {
pub build_mode: Option<BuildMode>,
#[serde(default)]
pub out_name: Option<String>,
#[merge(strategy = merge::vec::append)]
#[merge(strategy = merge::vec::prepend)]
#[serde(default)]
pub extra_options: Vec<String>,
#[serde(default)]
Expand Down
16 changes: 8 additions & 8 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ pub fn run() -> Result<(), anyhow::Error> {
ModeConfiguration::Copy {
destination,
branch,
build,
mut build,
include_files,
prune,
} => {
config.build.merge(build);
run_build(&root, &config.build)?;
build.merge(config.build);
run_build(&root, &build)?;
run_copy(
&root,
&config.build.path,
&build.path,
&destination,
&branch,
&include_files,
Expand All @@ -64,7 +64,7 @@ pub fn run() -> Result<(), anyhow::Error> {
ModeConfiguration::Upload {
authentication,
branch,
build,
mut build,
include_files,
hostname,
ssl,
Expand All @@ -83,11 +83,11 @@ pub fn run() -> Result<(), anyhow::Error> {
}
);

config.build.merge(build);
run_build(&root, &config.build)?;
build.merge(config.build);
run_build(&root, &build)?;
run_upload(
&root,
&config.build.path,
&build.path,
&authentication,
&branch,
&include_files,
Expand Down

0 comments on commit cc5d4ab

Please sign in to comment.