forked from ConstellationStarStudio/Cosmos-Adventure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirectory_clear.js
More file actions
28 lines (23 loc) · 895 Bytes
/
directory_clear.js
File metadata and controls
28 lines (23 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const fs = require('fs');
const path = require('path');
// Base path for Minecraft Bedrock Edition packs
const basePath = "C:\\Users\\ADMIN\\AppData\\Local\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\LocalState\\games\\com.mojang";
// Directories to check
const packFolders = ["behavior_packs", "resource_packs"];
// Name of the folder to delete
const folderToDelete = "CosmosAdve";
packFolders.forEach(packFolder => {
const folderPath = path.join(basePath, packFolder, folderToDelete);
if (fs.existsSync(folderPath)) {
// Remove the folder recursively
fs.rm(folderPath, { recursive: true, force: true }, (err) => {
if (err) {
console.error(`Error deleting folder at ${folderPath}:`, err);
} else {
console.log(`Successfully deleted folder: ${folderPath}`);
}
});
} else {
console.log(`Folder not found: ${folderPath}`);
}
});