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.
52 lines
1.0 KiB
Rust
52 lines
1.0 KiB
Rust
use igloo_base::*;
|
|
use igloo_base::IglooErrType::*;
|
|
|
|
use crate::Igloo;
|
|
use crate::igloo_project::IglooPrj;
|
|
|
|
pub fn run(prj_name: &str, target: &str) -> IglooErrType
|
|
{
|
|
let res_err: IglooErrType = ErrNone;
|
|
res_err
|
|
}
|
|
|
|
pub fn new(inst: &Igloo, prj_name: &str, target: &str)
|
|
-> IglooErrType
|
|
{
|
|
let mut res_err: IglooErrType = ErrNone;
|
|
// Check if we are already inside of an igloo project
|
|
// Creating an igloo project inside an igloo project
|
|
// is a no no
|
|
if std::path::Path::new(".igloo").exists()
|
|
{
|
|
res_err = NewCalledInsideProject;
|
|
return res_err
|
|
}
|
|
// Check if the project folder already exists
|
|
// Don't want to accidentally overwrite anything
|
|
if std::path::Path::new(prj_name).exists()
|
|
{
|
|
res_err = FolderAlreadyExists;
|
|
return res_err
|
|
}
|
|
|
|
let mut project = IglooPrj::new(inst, prj_name, target);
|
|
match project
|
|
{
|
|
Err(e) =>
|
|
{
|
|
println!("Error spawning project: {:?}", e);
|
|
res_err = e;
|
|
return res_err
|
|
}
|
|
_ => (),
|
|
}
|
|
|
|
let res_err = project.unwrap().populate();
|
|
if res_err != ErrNone
|
|
{
|
|
return res_err
|
|
}
|
|
res_err
|
|
}
|