Skip to content

Commit

Permalink
fix: Use nightly when opininated rustfmt is chosen 🐛 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Dec 31, 2023
1 parent ecbed1e commit 21db60e
Showing 1 changed file with 10 additions and 7 deletions.
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");

0 comments on commit 21db60e

Please sign in to comment.