Skip to content

Commit

Permalink
added detection deletion of extracted cpk folder in output folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusiege committed Nov 27, 2023
1 parent c2ec52e commit e7038b8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/nier_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ Future<void> main(List<String> arguments) async {
}
}
}
await deleteFolders(output, [
'data002.cpk_extracted',
'data012.cpk_extracted',
'data100.cpk_extracted'
]);
print("Randomizing complete");
}

Expand Down Expand Up @@ -271,3 +276,18 @@ Future<List<String>> readConfig() async {
.toList();
return args;
}

Future<void> deleteFolders(
String directoryPath, List<String> folderNames) async {
for (var folderName in folderNames) {
var folderPath = Directory(join(directoryPath, folderName));
if (await folderPath.exists()) {
try {
await folderPath.delete(recursive: true);
print('Deleted folder: $folderName');
} catch (e) {
print('Error deleting folder $folderName: $e');
}
}
}
}

0 comments on commit e7038b8

Please sign in to comment.