mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 10:41:57 +03:00
Add feature flag for updating the manifest
This commit is contained in:
parent
2a82a760f6
commit
515dc8204b
@ -150,8 +150,9 @@ version = "0.5"
|
||||
version = "0.11.2"
|
||||
|
||||
[features]
|
||||
default = [ ]
|
||||
default = [ "update_manifest" ]
|
||||
ci_skip = [ "leo-compiler/ci_skip" ]
|
||||
update_manifest = [ "leo-package/update_manifest" ]
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
|
@ -41,3 +41,7 @@ version = "0.5"
|
||||
|
||||
[dev-dependencies.lazy_static]
|
||||
version = "1.3.0"
|
||||
|
||||
[features]
|
||||
default = [ ]
|
||||
update_manifest = [ ]
|
@ -183,11 +183,15 @@ author = "{author}"
|
||||
}
|
||||
|
||||
// Rewrite the toml file if it has been updated
|
||||
#[cfg(feature = "update_manifest")]
|
||||
{
|
||||
if buffer != new_toml {
|
||||
let mut file = File::create(&path).map_err(|error| ManifestError::Creating(MANIFEST_FILENAME, error))?;
|
||||
let mut file =
|
||||
File::create(&path).map_err(|error| ManifestError::Creating(MANIFEST_FILENAME, error))?;
|
||||
file.write_all(new_toml.as_bytes())
|
||||
.map_err(|error| ManifestError::Writing(MANIFEST_FILENAME, error))?;
|
||||
}
|
||||
}
|
||||
|
||||
// Read the toml file
|
||||
Ok(toml::from_str(&new_toml).map_err(|error| ManifestError::Parsing(MANIFEST_FILENAME, error))?)
|
||||
|
Loading…
Reference in New Issue
Block a user