Skip to content

Commit

Permalink
fix(defaults-helper): rerun on changes to any file in defaults.d
Browse files Browse the repository at this point in the history
  • Loading branch information
cbgbt committed Jan 3, 2025
1 parent 2a7c098 commit 6d163fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ members = [
bottlerocket-settings-plugin = { path = "./bottlerocket-settings-plugin", version = "0.1" }
bottlerocket-settings-derive = { path = "./bottlerocket-settings-derive", version = "0.1" }
bottlerocket-settings-sdk = { path = "./bottlerocket-settings-sdk", version = "0.1" }
bottlerocket-defaults-helper = { path = "./bottlerocket-defaults-helper", version = "0.1" }
bottlerocket-defaults-helper = { path = "./bottlerocket-defaults-helper", version = "0.1.1" }
bottlerocket-template-helper = { path = "./bottlerocket-template-helper", version = "0.1" }

# Settings Models
Expand Down
2 changes: 1 addition & 1 deletion bottlerocket-defaults-helper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bottlerocket-defaults-helper"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
Expand Down
6 changes: 3 additions & 3 deletions bottlerocket-defaults-helper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub fn generate_defaults_toml() -> Result<()> {
})?);
defaults_dir.push("defaults.d");

// Reflect that we need to rerun if any of the default settings files have changed.
println!("cargo::rerun-if-changed={}", defaults_dir.display());

// Find TOML config files specified by the variant.
let walker = WalkDir::new(&defaults_dir)
.follow_links(true) // we expect users to link to shared files
Expand All @@ -39,9 +42,6 @@ pub fn generate_defaults_toml() -> Result<()> {
for entry in walker {
let entry = entry.context(error::ListFilesSnafu { dir: &defaults_dir })?;

// Reflect that we need to rerun if any of the default settings files have changed.
println!("cargo:rerun-if-changed={}", entry.path().display());

let data = fs::read_to_string(entry.path()).context(error::FileSnafu {
op: "read",
path: entry.path(),
Expand Down

0 comments on commit 6d163fc

Please sign in to comment.