fmt: v fmt
This commit is contained in:
parent
25ecba3fbb
commit
2c82da969e
3 changed files with 6 additions and 6 deletions
|
@ -166,7 +166,7 @@ fn build(config config.Config, mut logger log.Log) ! {
|
||||||
logger.info('start md to html')
|
logger.info('start md to html')
|
||||||
for path in mds {
|
for path in mds {
|
||||||
if b.is_ignore(path) {
|
if b.is_ignore(path) {
|
||||||
logger.info('$path is included in ignore_files, skip build')
|
logger.info('${path} is included in ignore_files, skip build')
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
b.md2html(path)!
|
b.md2html(path)!
|
||||||
|
|
|
@ -96,7 +96,7 @@ fn watch(path string, config config.Config, mut logger log.Log) {
|
||||||
}
|
}
|
||||||
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}')
|
||||||
w.time_stamp = now
|
w.time_stamp = now
|
||||||
|
|
||||||
build(config, mut logger) or {
|
build(config, mut logger) or {
|
||||||
|
@ -117,7 +117,7 @@ fn serve(mut logger log.Log) ! {
|
||||||
port: commands.cport
|
port: commands.cport
|
||||||
}
|
}
|
||||||
|
|
||||||
local_base_url := 'http://localhost:$commands.cport/'
|
local_base_url := 'http://localhost:${commands.cport}/'
|
||||||
mut config := load_config(default_config)!
|
mut config := load_config(default_config)!
|
||||||
config.base_url = local_base_url
|
config.base_url = local_base_url
|
||||||
println(local_base_url)
|
println(local_base_url)
|
||||||
|
@ -128,7 +128,7 @@ fn serve(mut logger log.Log) ! {
|
||||||
println('Build failed')
|
println('Build failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
w := go watch('.', config, mut logger)
|
w := spawn watch('.', config, mut logger)
|
||||||
server.listen_and_serve()
|
server.listen_and_serve()
|
||||||
|
|
||||||
w.wait()
|
w.wait()
|
||||||
|
|
|
@ -24,8 +24,8 @@ pub mut:
|
||||||
pub fn load(toml_text string) !Config {
|
pub fn load(toml_text string) !Config {
|
||||||
doc := toml.parse_text(toml_text)!
|
doc := toml.parse_text(toml_text)!
|
||||||
|
|
||||||
mut config := doc.reflect<Config>()
|
mut config := doc.reflect[Config]()
|
||||||
config.build = doc.value('build').reflect<Build>()
|
config.build = doc.value('build').reflect[Build]()
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue