Refactoring: Move logic around

This commit is contained in:
Artur Gurgul 2025-02-25 09:35:07 +01:00
parent 83fd79f674
commit 61df58cc7b
11 changed files with 123 additions and 99 deletions

View file

@ -2,29 +2,27 @@ import { Command } from 'commander'
import chalk from 'chalk'
//import fs from 'fs-extra'
import path from 'path'
import { newProject, buildProject, appProject } from './project.js'
import Project from './project.js'
import { serve } from './serve.js'
const program = new Command()
let project = new Project()
program
.command('init')
.description('Initialize project in the current directory with the default theme')
.action(newProject)
.action(()=> { project.new() })
program
.command('build')
.description('Build the webpage')
.action(buildProject)
.action(()=> { project.build() })
program
.command('serve')
.description('Run the website locally')
.action(serve)
program
.command('app')
.description('Run notes as the the app')
.action(appProject)
program.parse(process.argv)