valor_config/config/
mod.rs1use std::{
2 ffi::OsStr,
3 fmt::Formatter,
4 fs::read_to_string,
5 path::{Path, PathBuf},
6};
7
8use serde::de::{MapAccess, Visitor};
9use serde_derive::Serialize;
10use valkyrie_errors::ValkyrieResult;
11
12use crate::{bind_writer, DependencyKind, DependencyResolver, ValorPackage, ValorWorkspace};
13
14mod der;
15
16#[derive(Clone, Debug, Default, Serialize)]
17pub struct ValorConfig {
18 workspace: ValorWorkspace,
19 package: ValorPackage,
20 scripts: Vec<String>,
21 dependencies: DependencyResolver,
22}
23
24pub enum SupportFormat {
25 Nothing,
26 Toml,
27 Json,
28}
29
30impl ValorConfig {
31 pub fn is_workspace(&self) -> bool {
32 self.workspace.root != PathBuf::from("<<MISSING>>")
33 }
34 pub fn is_template(&self) -> bool {
35 !self.package.is_valid()
36 }
37 pub fn is_package(&self) -> bool {
38 !self.is_workspace() && !self.is_template()
39 }
40}