remove empty resources in case of dry launch

This commit is contained in:
SpikeHD
2022-06-05 21:15:50 -07:00
parent 04a29ce567
commit c1b5256a5b
5 changed files with 11 additions and 12 deletions

View File

@@ -73,7 +73,9 @@ export default class Downloads extends React.Component<IProps, IState> {
if (gc_path) {
const resources_exist: boolean = await invoke('dir_exists', {
path: path + '\\resources'
})
}) as boolean && !(await invoke('dir_is_empty', {
path: path + '\\resources'
})) as boolean
this.setState({
grasscutter_set: gc_path !== '',
@@ -153,7 +155,7 @@ export default class Downloads extends React.Component<IProps, IState> {
if (await invoke('dir_exists', {
path: folder + '\\resources'
})) {
await invoke('delete_dir', {
await invoke('dir_delete', {
path: folder + '\\resources'
})
}