You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.2 KiB
Rust
64 lines
1.2 KiB
Rust
use crate::Igloo;
|
|
use crate::igloo_cli::*;
|
|
|
|
use crate::IglooType;
|
|
use crate::IglooType::*;
|
|
|
|
use crate::IglooStatus;
|
|
use crate::IglooStatus::*;
|
|
|
|
use crate::igloo_target::IglooTarget;
|
|
|
|
pub struct IglooProject<'a>
|
|
{
|
|
igloo: &'a Igloo,
|
|
name: String,
|
|
targets: Vec<IglooTarget>,
|
|
}
|
|
|
|
impl<'a> IglooProject<'a>
|
|
{
|
|
/// Used to populate an IglooProject from scratch
|
|
/// This means we do not yet have any project in storage
|
|
/// and we must generate those directories, files, and symlinks
|
|
/// and then populate the project in memory
|
|
pub fn from_new(igloo_in: &'a Igloo, project_name: String) -> IglooProject
|
|
{
|
|
IglooProject
|
|
{
|
|
name: ich_new_get_project_name(igloo_in),
|
|
/// targets -- a vector of targets added for this project
|
|
targets: Vec::default(),
|
|
igloo: igloo_in,
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
/// Used to populate an IglooProject from an existing project
|
|
/// So this will be called when things like
|
|
/// igloo run, push, pull, erase, etc... are called
|
|
pub fn from_existing(igloo: &'a Igloo) -> IglooProject
|
|
{
|
|
IglooProject
|
|
{
|
|
name:
|
|
}
|
|
}
|
|
|
|
pub fn is_igloo_prj(path: &std::path::PathBuf) -> bool
|
|
{
|
|
if !path.join("igloo").exists()
|
|
{
|
|
return false
|
|
}
|
|
|
|
if !path.join("igloo.toml").exists()
|
|
{
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|