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

bin2v: validate .v file extension

This commit is contained in:
Lukas Neubert 2020-06-24 14:13:31 +02:00 committed by GitHub
parent 30169f86c1
commit 13faf864cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,8 +101,11 @@ fn main() {
}
context.files = real_files
if !context.write_file.ends_with('.v') {
context.write_file += '.v'
}
if context.write_file.len > 0 {
mut out_file := os.create('${context.write_file}.v') or { panic(err) }
mut out_file := os.create(context.write_file) or { panic(err) }
out_file.write(context.header())
for file in real_files {
out_file.write(context.file2v(file))