summaryrefslogtreecommitdiff
path: root/cmd/main.go
diff options
context:
space:
mode:
authorHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-25 09:45:52 +0000
committerHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-25 09:45:52 +0000
commitaf806b047446203aa714ae23b880e17bcf715294 (patch)
tree2fbd18537b72258d6dcde45b0041618b8cf4e774 /cmd/main.go
parent8056adbc8fd1ec8e4ac165c79f678de3f270e896 (diff)
feat: add build <theme> command
Diffstat (limited to 'cmd/main.go')
-rw-r--r--cmd/main.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/main.go b/cmd/main.go
index e60dbb7..13970cc 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -12,8 +12,6 @@ import (
internal "github.com/HimanshuSardana/kite/internal/build"
)
-var themeName = "gruvbox"
-
func copyFile(src, dst string) error {
in, err := os.Open(src)
if err != nil {
@@ -35,12 +33,14 @@ func copyFile(src, dst string) error {
return err
}
+var defaultThemeName = "modern-dark"
+
func main() {
args := os.Args
if len(args) > 1 {
switch args[1] {
case "serve":
- copyFile("./themes/"+themeName+"/style.css", "./output/style.css")
+ copyFile("./themes/"+defaultThemeName+"/style.css", "./output/style.css")
fs := http.FileServer(http.Dir("./output/"))
http.Handle("/", fs)
@@ -52,7 +52,13 @@ func main() {
log.Fatalf("Error occured %s\n", err)
}
case "build":
- internal.Build()
+ if len(os.Args) <= 2 {
+ themeName := defaultThemeName
+ internal.Build(themeName)
+ } else {
+ themeName := os.Args[2]
+ internal.Build(themeName)
+ }
case "list-themes":
themeList := internal.ListThemes()
fmt.Println(strings.Join(themeList, "\n"))