From e63e3c3caf692e672fffad280a61a0d3460b2600 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 23 Oct 2024 18:35:37 -0700 Subject: [PATCH] feedback 1_5 --- dsc/{settings.dsc.json => dsc.settings.json} | 0 dsc/tests/dsc_settings.tests.ps1 | 4 ++-- dsc_lib/src/util.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) rename dsc/{settings.dsc.json => dsc.settings.json} (100%) diff --git a/dsc/settings.dsc.json b/dsc/dsc.settings.json similarity index 100% rename from dsc/settings.dsc.json rename to dsc/dsc.settings.json diff --git a/dsc/tests/dsc_settings.tests.ps1 b/dsc/tests/dsc_settings.tests.ps1 index 1aa9a899..71b33469 100644 --- a/dsc/tests/dsc_settings.tests.ps1 +++ b/dsc/tests/dsc_settings.tests.ps1 @@ -5,13 +5,13 @@ Describe 'tests for dsc settings' { BeforeAll { $script:policyFilePath = if ($IsWindows) { - Join-Path $env:ProgramData "dsc" "settings.dsc.json" + Join-Path $env:ProgramData "dsc" "dsc.settings.json" } else { "/etc/dsc/settings.dsc.json" } $script:dscHome = (Get-Command dsc).Path | Split-Path - $script:dscSettingsFilePath = Join-Path $script:dscHome "settings.dsc.json" + $script:dscSettingsFilePath = Join-Path $script:dscHome "dsc.settings.json" $script:dscDefaultv1SettingsFilePath = Join-Path $script:dscHome "default_settings.v1.dsc.json" $script:dscDefaultv1SettingsJson = Get-Content -Raw -Path $script:dscDefaultv1SettingsFilePath diff --git a/dsc_lib/src/util.rs b/dsc_lib/src/util.rs index 2ac0050d..73fd1436 100644 --- a/dsc_lib/src/util.rs +++ b/dsc_lib/src/util.rs @@ -70,7 +70,7 @@ pub fn parse_input_to_json(value: &str) -> Result { /// Will return `Err` if could not find requested setting. pub fn get_setting(value_name: &str) -> Result { - const SETTINGS_FILE_NAME: &str = "settings.dsc.json"; + const SETTINGS_FILE_NAME: &str = "dsc.settings.json"; // Note that default settings file name has a version that is specific to this version of dsc const DEFAULT_SETTINGS_FILE_NAME: &str = "default_settings.v1.dsc.json"; @@ -140,16 +140,16 @@ fn load_value_from_json(path: &PathBuf, value_name: &str) -> Result String { - // $env:ProgramData+"\dsc\settings.dsc.json" + // $env:ProgramData+"\dsc\dsc.settings.json" // This location is writable only by admins, but readable by all users let Ok(local_program_data_path) = std::env::var("ProgramData") else { return String::new(); }; - Path::new(&local_program_data_path).join("dsc").join("settings.dsc.json").display().to_string() + Path::new(&local_program_data_path).join("dsc").join("dsc.settings.json").display().to_string() } #[cfg(not(target_os = "windows"))] fn get_settings_policy_file_path() -> String { - // "/etc/dsc/settings.dsc.json" + // "/etc/dsc/dsc.settings.json" // This location is writable only by admins, but readable by all users - Path::new("/etc").join("dsc").join("settings.dsc.json").display().to_string() + Path::new("/etc").join("dsc").join("dsc.settings.json").display().to_string() }