codeplay-common 1.0.53 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/uninstall.js +20 -0
package/package.json
CHANGED
package/scripts/uninstall.js
CHANGED
|
@@ -7,6 +7,7 @@ const filePrefixes = [
|
|
|
7
7
|
];
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
const splashXmlPath = path.join(projectRoot, "splashxml"); // Path to splashxml folder
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -19,6 +20,25 @@ const commonBuildPath = path.join(__dirname, "../files"); // Path where files we
|
|
|
19
20
|
process.stdout.write("🚀 Uninstalling: Removing old and copied files...");
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
const removeDirectory = (dirPath) => {
|
|
25
|
+
if (fs.existsSync(dirPath)) {
|
|
26
|
+
fs.readdirSync(dirPath).forEach(file => {
|
|
27
|
+
const currentPath = path.join(dirPath, file);
|
|
28
|
+
if (fs.lstatSync(currentPath).isDirectory()) {
|
|
29
|
+
removeDirectory(currentPath);
|
|
30
|
+
} else {
|
|
31
|
+
fs.unlinkSync(currentPath);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
fs.rmdirSync(dirPath);
|
|
35
|
+
process.stdout.write(`🗑️ Removed folder: ${dirPath}\n`);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
removeDirectory(splashXmlPath);
|
|
40
|
+
|
|
41
|
+
|
|
22
42
|
// Helper function to extract version from filename
|
|
23
43
|
const extractVersion = (filename) => {
|
|
24
44
|
const match = filename.match(/-(\d+\.\d+)\.js$/);
|