版博士V2.0程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

28 linhas
821 B

  1. #!/usr/bin/env node
  2. import path from "node:path";
  3. import minimist from "minimist";
  4. import { Plop, run } from "../../../instrumented/src/plop.js";
  5. const args = process.argv.slice(2);
  6. const argv = minimist(args);
  7. import { fileURLToPath } from "node:url";
  8. const __dirname = path.dirname(fileURLToPath(import.meta.url));
  9. Plop.prepare(
  10. {
  11. cwd: argv.cwd,
  12. preload: argv.preload || [],
  13. // In order for `plop` to always pick up the `plopfile.js` despite the CWD, you must use `__dirname`
  14. configPath: path.join(__dirname, "plopfile.cjs"),
  15. completion: argv.completion,
  16. // This will merge the `plop` argv and the generator argv.
  17. // This means that you don't need to use `--` anymore
  18. },
  19. function (env) {
  20. Plop.execute(env, function (env) {
  21. return run(env, undefined, true);
  22. });
  23. }
  24. );