codeplay-common 1.0.52 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "preinstall": "node scripts/uninstall.js"
@@ -1,3 +1,16 @@
1
+ // Define file prefixes to delete
2
+ const filePrefixes = [
3
+ "add-splash-screen",
4
+ "setSplashAnimation",
5
+ "codeplayBeforeBuild",
6
+ "finalrelease"
7
+ ];
8
+
9
+
10
+ const splashXmlPath = path.join(projectRoot, "splashxml"); // Path to splashxml folder
11
+
12
+
13
+
1
14
  const fs = require("fs");
2
15
  const path = require("path");
3
16
 
@@ -6,6 +19,26 @@ const commonBuildPath = path.join(__dirname, "../files"); // Path where files we
6
19
 
7
20
  process.stdout.write("🚀 Uninstalling: Removing old and copied files...");
8
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
+
9
42
  // Helper function to extract version from filename
10
43
  const extractVersion = (filename) => {
11
44
  const match = filename.match(/-(\d+\.\d+)\.js$/);
@@ -34,8 +67,7 @@ filesInProject.forEach(file => {
34
67
  });
35
68
 
36
69
 
37
- // Define file prefixes to delete
38
- const filePrefixes = ["add-splash-screen", "setSplashAnimation", "codeplayBeforeBuild"];
70
+
39
71
 
40
72
  // Step 1: Find all matching files in the project directory
41
73
  const filesInProject1 = fs.readdirSync(projectRoot)