-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add featuremanifestsupport config option
- Loading branch information
1 parent
ba75b55
commit 214c97d
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use crate::config_file::{load_config_db, load_mut_config_db, save_config_db}; | ||
use anyhow::{Context, Result}; | ||
|
||
pub fn run_command_config_featuremanifestsupport( | ||
value: Option<bool>, | ||
quiet: bool, | ||
paths: &crate::global_paths::GlobalPaths, | ||
) -> Result<()> { | ||
match value { | ||
Some(value) => { | ||
let mut config_file = load_mut_config_db(paths) | ||
.with_context(|| "`config` command failed to load configuration data.")?; | ||
|
||
let mut value_changed = false; | ||
|
||
if value != config_file.data.settings.feature_manifest_support { | ||
config_file.data.settings.feature_manifest_support = value; | ||
|
||
value_changed = true; | ||
} | ||
|
||
save_config_db(&mut config_file) | ||
.with_context(|| "Failed to save configuration file from `config` command.")?; | ||
|
||
if !quiet { | ||
if value_changed { | ||
eprintln!("Property 'featuremanifestsupport' set to '{}'", value); | ||
} else { | ||
eprintln!( | ||
"Property 'featuremanifestsupport' is already set to '{}'", | ||
value | ||
); | ||
} | ||
} | ||
} | ||
None => { | ||
let config_file = load_config_db(paths) | ||
.with_context(|| "`config` command failed to load configuration data.")?; | ||
|
||
if !quiet { | ||
eprintln!( | ||
"Property 'featuremanifestsupport' set to '{}'", | ||
config_file.data.settings.feature_manifest_support | ||
); | ||
} | ||
} | ||
}; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters