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

os: fix os.cp_all, by making the dst folder, if it does not exist already

This commit is contained in:
Delyan Angelov
2021-03-12 16:26:55 +02:00
parent e229d0c1c3
commit 995db65471
2 changed files with 7 additions and 2 deletions

View File

@ -48,6 +48,9 @@ pub fn cp_all(src string, dst string, overwrite bool) ? {
cp(source_path, adjusted_path) ?
return
}
if !exists(dest_path) {
mkdir(dest_path) ?
}
if !is_dir(dest_path) {
return error('Destination path is not a valid directory')
}