codeplay-common 4.7.8 → 4.7.9

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.
@@ -66,9 +66,10 @@ console.log("šŸ” Using keystore:", keystorePath);
66
66
 
67
67
 
68
68
  // Gradle args
69
+ const isWindows = process.platform === "win32";
70
+ const command = isWindows ? "cmd.exe" : "sh";
69
71
  const args = [
70
- "/c",
71
- "gradlew.bat",
72
+ ...(isWindows ? ["/c", "gradlew.bat"] : ["./gradlew"]),
72
73
  "assembleRelease",
73
74
  `-Pandroid.injected.signing.store.file=${keystorePath}`,
74
75
  `-Pandroid.injected.signing.store.password=${storePassword}`,
@@ -77,16 +78,21 @@ const args = [
77
78
  ];
78
79
 
79
80
  // Run Gradle
80
- const gradle = spawn("cmd.exe", args, {
81
+ const gradle = spawn(command, args, {
81
82
  cwd: androidPath,
82
83
  stdio: "inherit",
83
84
  });
84
85
 
86
+ gradle.on("error", (error) => {
87
+ console.error("āŒ Could not start Gradle:", error.message);
88
+ process.exit(1);
89
+ });
90
+
85
91
  gradle.on("close", (code) => {
86
92
  if (code === 0) {
87
93
  console.log("\nāœ… Signed APK Generated Successfully!");
88
94
  } else {
89
95
  console.log("\nāŒ Build Failed with code:", code);
90
- process.exit(code);
96
+ process.exit(code ?? 1);
91
97
  }
92
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.7.8",
3
+ "version": "4.7.9",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",