-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchetype.rhai
44 lines (31 loc) · 1.15 KB
/
archetype.rhai
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let context = #{};
context.archetect_version = archetect::version();
// This generally comes from ANSWERS, but prompting for it ensures it is in the context
context += prompt("Project Author:", "author_full", #{
placeholder: "Your Name <[email protected]>",
});
context += prompt("Archetype Description:", "description", #{
placeholder: "Python Fast API Service"
});
let description = context.description;
remove(description, " archetype");
remove(description, " Archetype");
context.description = description;
context += prompt("Archetype Name:", "archetype-name", #{
defaults_with: kebab_case(context["description"]),
cases: [
CasedValue(KebabCase),
],
});
context += prompt("Author:", "author_full", #{
placeholder: "Your Name <[email protected]>",
help: "Author Name and Email",
});
context += prompt("Git Repo:", "git-repo", #{
placeholder: `http://github.com/your-name/${context["archetype-name"]}.archetype.git`,
optional: true,
});
render(Directory("contents"), context);
render(Archetype("gitignore"), Path(`${context["archetype-name"]}.archetype`), #{
ignore: ["IDEA", "VSCode", "Eclipse"]
});