Skip to content

Commit c460223

Browse files
fix: handle missing fdroid.bool
1 parent 10f82de commit c460223

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

hooks/post-process.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ function getTmpDir() {
5050
fs.accessSync("/tmp", fs.constants.R_OK | fs.constants.W_OK);
5151
return "/tmp";
5252
} catch {
53-
console.error("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
54-
process.exit(1);
53+
console.log("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
54+
return null;
55+
// process.exit(1);
5556
}
5657
}
5758

@@ -78,8 +79,12 @@ function patchTargetSdkVersion() {
7879
api = "28";
7980
}
8081
} else {
81-
console.error(`${getTmpDir()}/fdroid.bool not found`);
82-
process.exit(1);
82+
console.warn("---------------------------------------------------------------------------------\n\n\n\n");
83+
console.warn(`⚠️ ${getTmpDir()}/fdroid.bool not found`);
84+
console.warn("⚠️ Fdroid flavour will be built");
85+
api = "28";
86+
console.warn("\n\n\n\n---------------------------------------------------------------------------------");
87+
//process.exit(1);
8388
}
8489

8590
content = content.replace(sdkRegex, 'targetSdkVersion ' + api);

utils/scripts/build.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,23 @@ if [ -n "$TMPDIR" ] && [ -r "$TMPDIR" ] && [ -w "$TMPDIR" ]; then
3535
elif [ -r "/tmp" ] && [ -w "/tmp" ]; then
3636
tmpdir="/tmp"
3737
else
38-
echo "Error: No usable temporary directory found (TMPDIR or /tmp not accessible)." >&2
39-
exit 1
38+
echo "Warning: No usable temporary directory found (TMPDIR or /tmp not accessible). Skipping fdroid.bool file." >&2
39+
tmpdir=""
4040
fi
4141

4242
if [[ "$fdroidFlag" == "fdroid" ]]; then
43-
echo "true" > "$tmpdir/fdroid.bool"
43+
if [ -n "$tmpdir" ]; then
44+
echo "true" > "$tmpdir/fdroid.bool"
45+
fi
4446
cordova plugin remove com.foxdebug.acode.rk.exec.proot
4547
else
46-
echo "false" > "$tmpdir/fdroid.bool"
48+
if [ -n "$tmpdir" ]; then
49+
echo "false" > "$tmpdir/fdroid.bool"
50+
fi
4751
cordova plugin add src/plugins/proot/
4852
fi
4953

54+
5055
# Normalize mode values
5156
if [ "$mode" = "p" ] || [ "$mode" = "prod" ]
5257
then

0 commit comments

Comments
 (0)