Jacky Zhao
2023-11-12 cf6ab9e9333b5f76cb9e06f6687f2b4f8fbe91bd
feat: option to specify npx quartz sync message (closes #583)
2 files modified
8 ■■■■ changed files
quartz/cli/args.js 5 ●●●●● patch | view | raw | blame | history
quartz/cli/handlers.js 3 ●●●● patch | view | raw | blame | history
quartz/cli/args.js
@@ -41,6 +41,11 @@
    default: true,
    describe: "create a git commit for your unsaved changes",
  },
  message: {
    string: true,
    alias: ["m"],
    describe: "option to override the default Quartz commit message",
  },
  push: {
    boolean: true,
    default: true,
quartz/cli/handlers.js
@@ -483,8 +483,9 @@
      dateStyle: "medium",
      timeStyle: "short",
    })
    const commitMessage = argv.message ?? `Quartz sync: ${currentTimestamp}`
    spawnSync("git", ["add", "."], { stdio: "inherit" })
    spawnSync("git", ["commit", "-m", `Quartz sync: ${currentTimestamp}`], { stdio: "inherit" })
    spawnSync("git", ["commit", "-m", commitMessage], { stdio: "inherit" })
    if (contentStat.isSymbolicLink()) {
      // put symlink back