版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
767 B

  1. export default function (plop) {
  2. plop.setGenerator("addAndNameFile", {
  3. description: "Name that file",
  4. prompts: [
  5. {
  6. type: "input",
  7. name: "fileName",
  8. message: "What should the file name be?",
  9. },
  10. ],
  11. actions: [
  12. {
  13. type: "add",
  14. path: "./output/{{fileName}}.txt",
  15. templateFile: "./templates/to-add.txt",
  16. },
  17. ],
  18. });
  19. plop.setGenerator("addAndChangeFile", {
  20. description: "Name that file",
  21. prompts: [
  22. {
  23. type: "input",
  24. name: "name",
  25. message: "What's your name?",
  26. },
  27. ],
  28. actions: [
  29. {
  30. type: "add",
  31. path: "./output/new-output.txt",
  32. templateFile: "./templates/to-add-change.txt",
  33. },
  34. ],
  35. });
  36. }