create-vuepress-theme-plume 1.0.0-rc.91 → 1.0.0-rc.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +7 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
  import cac from "cac";
3
3
 
4
4
  // src/run.ts
5
+ import process4 from "node:process";
6
+ import path4 from "node:path";
5
7
  import { intro, outro, spinner } from "@clack/prompts";
6
8
  import { execaCommand as execaCommand3 } from "execa";
7
9
  import colors from "picocolors";
@@ -335,7 +337,7 @@ async function getUserInfo() {
335
337
  // src/render.ts
336
338
  import handlebars from "handlebars";
337
339
  import { kebabCase as kebabCase2 } from "@pengzhanbo/utils";
338
- handlebars.registerHelper("removeLeadingSlash", (path4) => path4.replace(/^\//, ""));
340
+ handlebars.registerHelper("removeLeadingSlash", (path5) => path5.replace(/^\//, ""));
339
341
  handlebars.registerHelper("equal", (a, b) => a === b);
340
342
  function createRender(result) {
341
343
  const data = {
@@ -469,14 +471,15 @@ async function run(mode, root) {
469
471
  const progress = spinner();
470
472
  progress.start(t("spinner.start"));
471
473
  await generate(mode, data);
474
+ const cwd = path4.join(process4.cwd(), data.root);
472
475
  if (data.git) {
473
476
  progress.message(t("spinner.git"));
474
- await execaCommand3("git init");
477
+ await execaCommand3("git init", { cwd });
475
478
  }
476
479
  const pm = data.packageManager;
477
480
  if (data.install) {
478
481
  progress.message(t("spinner.install"));
479
- await execaCommand3(pm === "yarn" ? "yarn" : `${pm} install`);
482
+ await execaCommand3(pm === "yarn" ? "yarn" : `${pm} install`, { cwd });
480
483
  }
481
484
  const cdCommand = mode === 1 /* create */ ? colors.green(`cd ${data.root}`) : "";
482
485
  const runCommand = colors.green(pm === "yarn" ? "yarn dev" : `${pm} run dev`);
@@ -502,5 +505,5 @@ var cli = cac("create-vuepress-theme-plume");
502
505
  cli.command("[root]", "create a new vuepress-theme-plume project / \u521B\u5EFA\u65B0\u7684 vuepress-theme-plume \u9879\u76EE").action((root) => run(1 /* create */, root));
503
506
  cli.command("init [root]", "Initial vuepress-theme-plume in the existing project / \u5728\u73B0\u6709\u9879\u76EE\u4E2D\u521D\u59CB\u5316 vuepress-theme-plume").action((root) => run(0 /* init */, root));
504
507
  cli.help();
505
- cli.version("1.0.0-rc.90");
508
+ cli.version("1.0.0-rc.91");
506
509
  cli.parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-vuepress-theme-plume",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.91",
4
+ "version": "1.0.0-rc.92",
5
5
  "description": "The cli for create vuepress-theme-plume's project",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",