Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaults-helper: rerun on changes to any file in defaults.d #71

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading