Skip to content

Instantly share code, notes, and snippets.

@koplenov
Created November 24, 2023 07:34
Show Gist options
  • Save koplenov/c7d6e06e109e025d34b3b1b3939a304a to your computer and use it in GitHub Desktop.
Save koplenov/c7d6e06e109e025d34b3b1b3939a304a to your computer and use it in GitHub Desktop.
extract zip func with force overwrite files in v
fn fucking_extract_zip_to_dir(file string, dir string) {
temp_path := os.join_path(os.temp_dir(), rand.string(10))
os.mkdir_all(temp_path) or { panic(err) }
szip.extract_zip_to_dir(file, temp_path) or { panic(err) }
os.cp_all(temp_path, dir, true) or { panic(err) }
os.rmdir_all(temp_path) or { panic(err) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment