Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use @ instead of # for specifying a template branch #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fn create_template(template: CreateTemplate) {
.nice_unwrap("Unable to create project directory");
}

let (used_template, branch) = if template.template.contains('#') {
template.template.split_once('#').unwrap()
let (used_template, branch) = if template.template.contains('@') {
template.template.split_once('@').unwrap()
} else if template.template.contains('/') {
(template.template.as_str(), "main")
} else if template.template.is_empty() {
Expand Down Expand Up @@ -177,7 +177,7 @@ pub fn build_template(config: &mut Config, location: Option<PathBuf>) {
info!("Default: Create a simple mod that adds a button to the main menu.");
info!("Minimal: Create a minimal mod with only the necessary files.");
info!("Custom Layer: Create a mod with a custom layer and more UI elements.");
info!("Alternatively, you could use your own template: 'user/repo', 'user/repo#branch'");
info!("Alternatively, you could use your own template: 'user/repo', 'user/repo@branch'");
let template = ask_value("Template", Some(""), false);

let final_name = ask_value("Name", possible_name(&location).as_deref(), true);
Expand Down