mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
16 lines
342 B
TypeScript
16 lines
342 B
TypeScript
import { invoke } from '@tauri-apps/api'
|
|
import { listen } from '@tauri-apps/api/event'
|
|
|
|
export function unzip(file: string, dest: string, onFinish?: () => void) {
|
|
invoke('unzip', {
|
|
zipfile: file,
|
|
destpath: dest,
|
|
})
|
|
|
|
listen('extract_end', ({ payload }) => {
|
|
if (payload === file && onFinish) {
|
|
onFinish()
|
|
}
|
|
})
|
|
}
|