1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: bring back panic(err.msg) -> panic(err) (#9022)

This commit is contained in:
spaceface
2021-03-01 00:18:14 +01:00
committed by GitHub
parent ce115dcbe0
commit b712af56fd
110 changed files with 383 additions and 387 deletions

View File

@ -126,7 +126,7 @@ fn (vd VDoc) render_search_index(out Output) {
js_search_index.writeln('];')
js_search_data.writeln('];')
out_file_path := os.join_path(out.path, 'search_index.js')
os.write_file(out_file_path, js_search_index.str() + js_search_data.str()) or { panic(err.msg) }
os.write_file(out_file_path, js_search_index.str() + js_search_data.str()) or { panic(err) }
}
fn (mut vd VDoc) render_static_html(out Output) {
@ -162,7 +162,7 @@ fn (vd VDoc) get_resource(name string, out Output) string {
output_path := os.join_path(out.path, name)
if !os.exists(output_path) {
println('Generating $out.typ in "$output_path"')
os.write_file(output_path, res) or { panic(err.msg) }
os.write_file(output_path, res) or { panic(err) }
}
return name
}

View File

@ -162,7 +162,7 @@ fn (vd VDoc) work_processor(mut work sync.Channel, mut wg sync.WaitGroup) {
file_name, content := vd.render_doc(pdoc.d, pdoc.out)
output_path := os.join_path(pdoc.out.path, file_name)
println('Generating $pdoc.out.typ in "$output_path"')
os.write_file(output_path, content) or { panic(err.msg) }
os.write_file(output_path, content) or { panic(err) }
}
wg.done()
}
@ -350,15 +350,15 @@ fn (mut vd VDoc) generate_docs_from_file() {
out.path = os.real_path('.')
}
if !os.exists(out.path) {
os.mkdir(out.path) or { panic(err.msg) }
os.mkdir(out.path) or { panic(err) }
}
if cfg.is_multi {
out.path = os.join_path(out.path, '_docs')
if !os.exists(out.path) {
os.mkdir(out.path) or { panic(err.msg) }
os.mkdir(out.path) or { panic(err) }
} else {
for fname in css_js_assets {
os.rm(os.join_path(out.path, fname)) or { panic(err.msg) }
os.rm(os.join_path(out.path, fname)) or { panic(err) }
}
}
}
@ -372,11 +372,11 @@ fn (mut vd VDoc) generate_docs_from_file() {
vd.render_search_index(out)
// move favicons to target directory
println('Copying favicons...')
favicons := os.ls(favicons_path) or { panic(err.msg) }
favicons := os.ls(favicons_path) or { panic(err) }
for favicon in favicons {
favicon_path := os.join_path(favicons_path, favicon)
destination_path := os.join_path(out.path, favicon)
os.cp(favicon_path, destination_path) or { panic(err.msg) }
os.cp(favicon_path, destination_path) or { panic(err) }
}
}
}