mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
Bugfix/compat auto config (#812)
* account for no dependent config when auto configuring * fix config path * add check for config file to dependency check command
This commit is contained in:
@@ -201,18 +201,19 @@ fn inner_main() -> Result<(), anyhow::Error> {
|
||||
("dependency", Some(sub_m)) => match sub_m.subcommand() {
|
||||
("check", Some(sub_m)) => {
|
||||
let parent_config = serde_yaml::from_reader(stdin())?;
|
||||
let config = serde_yaml::from_reader(
|
||||
File::open(
|
||||
Path::new(sub_m.value_of("mountpoint").unwrap()).join("start9/config.yaml"),
|
||||
)
|
||||
.unwrap(),
|
||||
)?;
|
||||
let cfg_path =
|
||||
Path::new(sub_m.value_of("mountpoint").unwrap()).join("start9/config.yaml");
|
||||
let config = if cfg_path.exists() {
|
||||
Some(serde_yaml::from_reader(File::open(cfg_path).unwrap()).unwrap())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let rules_path = Path::new(sub_m.value_of("assets").unwrap());
|
||||
let name = sub_m.value_of("dependent_package_id").unwrap();
|
||||
let parent_name = sub_m.value_of("dependency_package_id").unwrap();
|
||||
match validate_dependency_configuration(
|
||||
name,
|
||||
config,
|
||||
&config,
|
||||
parent_name,
|
||||
parent_config,
|
||||
rules_path,
|
||||
@@ -229,12 +230,13 @@ fn inner_main() -> Result<(), anyhow::Error> {
|
||||
}
|
||||
("auto-configure", Some(sub_m)) => {
|
||||
let dep_config = serde_yaml::from_reader(stdin())?;
|
||||
let config = serde_yaml::from_reader(
|
||||
File::open(
|
||||
Path::new(sub_m.value_of("mountpoint").unwrap()).join("start9/config.yaml"),
|
||||
)
|
||||
.unwrap(),
|
||||
)?;
|
||||
let cfg_path =
|
||||
Path::new(sub_m.value_of("mountpoint").unwrap()).join("start9/config.yaml");
|
||||
let config = if cfg_path.exists() {
|
||||
Some(serde_yaml::from_reader(File::open(cfg_path).unwrap()).unwrap())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let rules_path = Path::new(sub_m.value_of("assets").unwrap());
|
||||
let package_id = sub_m.value_of("dependent_package_id").unwrap();
|
||||
let dependency_id = sub_m.value_of("dependency_package_id").unwrap();
|
||||
|
||||
Reference in New Issue
Block a user