Created
November 24, 2023 07:34
-
-
Save koplenov/c7d6e06e109e025d34b3b1b3939a304a to your computer and use it in GitHub Desktop.
extract zip func with force overwrite files in v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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