sajt/src/index.ts

24 lines
530 B
TypeScript
Raw Normal View History

2024-10-11 11:11:40 +02:00
import { Command } from 'commander'
2025-02-25 09:35:07 +01:00
import Project from './project.js'
2024-10-17 23:51:03 +02:00
import { serve } from './serve.js'
2024-08-15 19:52:42 +02:00
2024-10-11 11:11:40 +02:00
const program = new Command()
2025-02-25 09:35:07 +01:00
let project = new Project()
2024-10-11 11:11:40 +02:00
program
.command('init')
.description('Initialize project in the current directory with the default theme')
2025-02-25 09:35:07 +01:00
.action(()=> { project.new() })
2024-10-11 11:11:40 +02:00
2024-10-17 23:51:03 +02:00
program
2024-10-11 11:11:40 +02:00
.command('build')
.description('Build the webpage')
2025-02-25 09:35:07 +01:00
.action(()=> { project.build() })
2024-10-17 23:51:03 +02:00
program
.command('serve')
.description('Run the website locally')
.action(serve)
2024-10-11 11:11:40 +02:00
program.parse(process.argv)