mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 02:31:44 +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,10 +183,14 @@ author = "{author}"
|
||||
}
|
||||
|
||||
// Rewrite the toml file if it has been updated
|
||||
if buffer != new_toml {
|
||||
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))?;
|
||||
#[cfg(feature = "update_manifest")]
|
||||
{
|
||||
if buffer != new_toml {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user