From cf6ab9e9333b5f76cb9e06f6687f2b4f8fbe91bd Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 12 Nov 2023 22:27:53 +0000
Subject: [PATCH] feat: option to specify npx quartz sync message (closes #583)

---
 quartz/cli/handlers.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js
index cba0ceb..96ee9bc 100644
--- a/quartz/cli/handlers.js
+++ b/quartz/cli/handlers.js
@@ -1,4 +1,4 @@
-import { promises, readFileSync } from "fs"
+import { promises } from "fs"
 import path from "path"
 import esbuild from "esbuild"
 import chalk from "chalk"
@@ -402,7 +402,7 @@
       return serve()
     })
     server.listen(argv.port)
-    const wss = new WebSocketServer({ port: 3001 })
+    const wss = new WebSocketServer({ port: argv.wsPort })
     wss.on("connection", (ws) => connections.push(ws))
     console.log(
       chalk.cyan(
@@ -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

--
Gitblit v1.10.0