codeplay-common 2.1.10 → 2.1.12

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.
@@ -1,77 +1,77 @@
1
- // Define file prefixes to delete
2
- const filePrefixes = [
3
- "add-splash-screen",
4
- "setSplashAnimation",
5
- "codeplayBeforeBuild",
6
- "finalrelease"
7
- ];
8
-
9
- const fs = require("fs");
10
- const path = require("path");
11
-
12
- const projectRoot = path.resolve(__dirname, "../../../"); // Project root
13
- const commonBuildPath = path.join(__dirname, "../files"); // Path where files were copied from
14
- const splashXmlPath = path.join(projectRoot, "buildCodeplay"); // Path to splashxml folder
15
-
16
- process.stdout.write("🚀 Uninstalling: Removing old and copied files...\n");
17
-
18
- const removeDirectory = (dirPath) => {
19
- if (fs.existsSync(dirPath)) {
20
- fs.readdirSync(dirPath).forEach(file => {
21
- const currentPath = path.join(dirPath, file);
22
- if (fs.lstatSync(currentPath).isDirectory()) {
23
- removeDirectory(currentPath);
24
- } else {
25
- fs.unlinkSync(currentPath);
26
- }
27
- });
28
- fs.rmdirSync(dirPath);
29
- process.stdout.write(`🗑️ Removed folder: ${dirPath}\n`);
30
- }
31
- };
32
-
33
- removeDirectory(splashXmlPath);
34
- removeDirectory(path.join(projectRoot, "splashxml")); // Remove old splashxml folder
35
-
36
- // Step 1: Find all matching files in the project directory
37
- const filePatternsToRemove = [
38
- /^add-splash-screen-.*$/,
39
- /^setSplashAnimation-.*$/,
40
- /^codeplayBeforeBuild-.*$/,
41
- /^modify-plugin-xml\.xml$/,
42
- /^finalrelease.*$/,
43
- /^iap-install-\d+(\.\d+)?\.js$/,
44
- /^\.env\.storeid[1-7]$/,
45
- /^modify-plugin-xml\.js$/
46
- ];
47
-
48
- const filesInProject = fs.readdirSync(projectRoot);
49
-
50
- filesInProject.forEach(file => {
51
- if (filePatternsToRemove.some(pattern => pattern.test(file))) {
52
- const filePath = path.join(projectRoot, file);
53
- try {
54
- fs.unlinkSync(filePath);
55
- process.stdout.write(`🗑️ Removed file: ${filePath}\n`);
56
- } catch (error) {
57
- process.stderr.write(`⚠️ Failed to remove ${filePath}: ${error.message}\n`);
58
- }
59
- }
60
- });
61
-
62
- // Remove files listed in commonBuildPath
63
- if (fs.existsSync(commonBuildPath)) {
64
- fs.readdirSync(commonBuildPath).forEach(file => {
65
- const destPath = path.join(projectRoot, file);
66
- if (fs.existsSync(destPath)) {
67
- try {
68
- fs.unlinkSync(destPath);
69
- process.stdout.write(`🗑️ Removed file: ${destPath}\n`);
70
- } catch (error) {
71
- process.stderr.write(`⚠️ Failed to remove ${destPath}: ${error.message}\n`);
72
- }
73
- }
74
- });
75
- }
76
-
77
- process.stdout.write("✅ Uninstall cleanup complete!\n");
1
+ // Define file prefixes to delete
2
+ const filePrefixes = [
3
+ "add-splash-screen",
4
+ "setSplashAnimation",
5
+ "codeplayBeforeBuild",
6
+ "finalrelease"
7
+ ];
8
+
9
+ const fs = require("fs");
10
+ const path = require("path");
11
+
12
+ const projectRoot = path.resolve(__dirname, "../../../"); // Project root
13
+ const commonBuildPath = path.join(__dirname, "../files"); // Path where files were copied from
14
+ const splashXmlPath = path.join(projectRoot, "buildCodeplay"); // Path to splashxml folder
15
+
16
+ process.stdout.write("🚀 Uninstalling: Removing old and copied files...\n");
17
+
18
+ const removeDirectory = (dirPath) => {
19
+ if (fs.existsSync(dirPath)) {
20
+ fs.readdirSync(dirPath).forEach(file => {
21
+ const currentPath = path.join(dirPath, file);
22
+ if (fs.lstatSync(currentPath).isDirectory()) {
23
+ removeDirectory(currentPath);
24
+ } else {
25
+ fs.unlinkSync(currentPath);
26
+ }
27
+ });
28
+ fs.rmdirSync(dirPath);
29
+ process.stdout.write(`🗑️ Removed folder: ${dirPath}\n`);
30
+ }
31
+ };
32
+
33
+ removeDirectory(splashXmlPath);
34
+ removeDirectory(path.join(projectRoot, "splashxml")); // Remove old splashxml folder
35
+
36
+ // Step 1: Find all matching files in the project directory
37
+ const filePatternsToRemove = [
38
+ /^add-splash-screen-.*$/,
39
+ /^setSplashAnimation-.*$/,
40
+ /^codeplayBeforeBuild-.*$/,
41
+ /^modify-plugin-xml\.xml$/,
42
+ /^finalrelease.*$/,
43
+ /^iap-install-\d+(\.\d+)?\.js$/,
44
+ /^\.env\.storeid[1-7]$/,
45
+ /^modify-plugin-xml\.js$/
46
+ ];
47
+
48
+ const filesInProject = fs.readdirSync(projectRoot);
49
+
50
+ filesInProject.forEach(file => {
51
+ if (filePatternsToRemove.some(pattern => pattern.test(file))) {
52
+ const filePath = path.join(projectRoot, file);
53
+ try {
54
+ fs.unlinkSync(filePath);
55
+ process.stdout.write(`🗑️ Removed file: ${filePath}\n`);
56
+ } catch (error) {
57
+ process.stderr.write(`⚠️ Failed to remove ${filePath}: ${error.message}\n`);
58
+ }
59
+ }
60
+ });
61
+
62
+ // Remove files listed in commonBuildPath
63
+ if (fs.existsSync(commonBuildPath)) {
64
+ fs.readdirSync(commonBuildPath).forEach(file => {
65
+ const destPath = path.join(projectRoot, file);
66
+ if (fs.existsSync(destPath)) {
67
+ try {
68
+ fs.unlinkSync(destPath);
69
+ process.stdout.write(`🗑️ Removed file: ${destPath}\n`);
70
+ } catch (error) {
71
+ process.stderr.write(`⚠️ Failed to remove ${destPath}: ${error.message}\n`);
72
+ }
73
+ }
74
+ });
75
+ }
76
+
77
+ process.stdout.write("✅ Uninstall cleanup complete!\n");