pipelight_utils 0.2.9

A set of trivial utilities for command line tools
Documentation
// Structs
use crate::teleport::types::{Gate, Portal};
use pipelight_error::PipelightError;
// Environment
use std::env;
// Error Handling
use miette::{Context, Result};

impl Portal {
    /**
    Prefered way to instanciate a portal.
    Hydrate a default portal with current env.
    */
    pub fn new() -> Result<Self, PipelightError> {
        Ok(Portal {
            target: Gate::default(),
            origin: Gate::default().directory(env::current_dir().unwrap().display().to_string())?,
            current: Gate::default()
                .directory(env::current_dir().unwrap().display().to_string())?,
            seed: None,
        })
    }
}