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

fix: Use nightly when opininated rustfmt is chosen 🐛 #32

Merged
merged 1 commit into from
Dec 31, 2023
Merged
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
17 changes: 10 additions & 7 deletions async/template/hooks/pre-get-repository.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,24 @@ let use_rustfmt = if variable::is_set("use_rustfmt") {
variable::prompt("Use an opinionated rustfmt.toml file?", "false", ["true", "false"])
};

if use_rustfmt == "true" || use_rustfmt == true {
if use_rustfmt == "false" || use_rustfmt == false {
file::delete("./.rustfmt.toml");
} else {
print("!!! opinionated rustfmt.toml requires nightly.");
variable::set("msrv", "nightly");
}

let project_name = variable::get("project-name");
let crate_name = project_name;
crate_name.replace("-", "_");
crate_name.replace(" ", "_");
variable::set("crate_name", crate_name);

let msrv = if variable::is_set("msrv") {
variable::get("msrv")
} else {
variable::prompt("What is your Minimum Supported Rust Version", "stable")
};
variable::set("msrv", msrv);

let project_name = variable::get("project-name");
let crate_name = project_name;
crate_name.replace("-", "_");
crate_name.replace(" ", "_");
variable::set("crate_name", crate_name);

file::delete("./hooks");