Skip to content

Allow creating a TempProject in any arbitrary path #22

Closed as not planned
@DaniPopes

Description

@DaniPopes

Needed this to initialize a project in an already-initialized template at a fixed path in Foundry tests, basically:

/// Initializes a new project in the given directory.
pub fn initialize(at: &Path) {
    let global_path = Path::new("/tmp/my_template/");
    let project = MyProject::new_with_root(global_path); // Wraps TempProject
    if project.is_empty() { // std::fs::read_dir or whatever
        project.initialize().unwrap();
    }
    project.copy_to(at).unwrap();
    // can also return a new project here
    // Project::new_with_root(at)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions