init: Begin introducing units

Dependencies are not yet functional.
This commit is contained in:
bjorn3
2026-02-25 20:57:42 +01:00
parent f364bf1f60
commit 73cc0b0a07
7 changed files with 128 additions and 28 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use std::{env, fs, io, iter};
use std::path::PathBuf;
use std::{env, io, iter};
use crate::service::{Service, ServiceType};
@@ -15,11 +15,11 @@ fn subst_env<'a>(arg: &str) -> String {
pub struct Script(pub Vec<Command>);
impl Script {
pub fn from_file(file: &Path) -> io::Result<(Script, Vec<String>)> {
pub fn from_str(config: &str) -> io::Result<(Script, Vec<String>)> {
let mut cmds = vec![];
let mut errors = vec![];
for line_raw in fs::read_to_string(file)?.lines() {
for line_raw in config.lines() {
let line = line_raw.trim();
if line.is_empty() || line.starts_with('#') {
continue;