mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00

Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
* fix docker * test with docs folder
42 lines
1.1 KiB
JavaScript
Executable File
42 lines
1.1 KiB
JavaScript
Executable File
#!/usr/bin/env -S node --no-deprecation
|
|
import yargs from "yargs"
|
|
import { hideBin } from "yargs/helpers"
|
|
import {
|
|
handleBuild,
|
|
handleCreate,
|
|
handleUpdate,
|
|
handleRestore,
|
|
handleSync,
|
|
} from "./cli/handlers.js"
|
|
import { CommonArgv, BuildArgv, CreateArgv, SyncArgv } from "./cli/args.js"
|
|
import { version } from "./cli/constants.js"
|
|
|
|
yargs(hideBin(process.argv))
|
|
.scriptName("quartz")
|
|
.version(version)
|
|
.usage("$0 <cmd> [args]")
|
|
.command("create", "Initialize Quartz", CreateArgv, async (argv) => {
|
|
await handleCreate(argv)
|
|
})
|
|
.command("update", "Get the latest Quartz updates", CommonArgv, async (argv) => {
|
|
await handleUpdate(argv)
|
|
})
|
|
.command(
|
|
"restore",
|
|
"Try to restore your content folder from the cache",
|
|
CommonArgv,
|
|
async (argv) => {
|
|
await handleRestore(argv)
|
|
},
|
|
)
|
|
.command("sync", "Sync your Quartz to and from GitHub.", SyncArgv, async (argv) => {
|
|
await handleSync(argv)
|
|
})
|
|
.command("build", "Build Quartz into a bundle of static HTML files", BuildArgv, async (argv) => {
|
|
await handleBuild(argv)
|
|
})
|
|
.showHelpOnFail(false)
|
|
.help()
|
|
.strict()
|
|
.demandCommand().argv
|