🐛 fixed some bugs

main
zztkm 2 years ago
parent 8fdb437483
commit 9584b7e4de

@ -87,8 +87,12 @@ fn watch(path string, mut logger log.Log) {
watchers << w watchers << w
} }
ignore := "." + os.path_separator + "dist"
for { for {
for mut w in watchers { for mut w in watchers {
if w.path.starts_with(ignore) {
continue
}
now := os.file_last_mod_unix(w.path) now := os.file_last_mod_unix(w.path)
if now > w.time_stamp { if now > w.time_stamp {
println('modified file: $w.path') println('modified file: $w.path')
@ -112,7 +116,7 @@ fn serve(mut logger log.Log) ? {
port: commands.cport port: commands.cport
} }
println('http://localhost:$commands.cport') println('http://localhost:$commands.cport')
w := go watch('dist', mut logger) w := go watch('.', mut logger)
server.listen_and_serve() or { panic(err) } server.listen_and_serve() or { panic(err) }
w.wait() w.wait()

@ -6,7 +6,7 @@ import cli
pub fn execute() { pub fn execute() {
mut app := cli.Command{ mut app := cli.Command{
name: 'vss' name: 'vss'
version: '0.0.10' version: '0.0.11'
description: 'static site generator' description: 'static site generator'
execute: fn (cmd cli.Command) ? { execute: fn (cmd cli.Command) ? {
println(cmd.help_message()) println(cmd.help_message())

Loading…
Cancel
Save