[mv3] Use default file permissions on created temp file

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/397
This commit is contained in:
Raymond Hill 2025-07-30 08:45:16 -04:00
parent 4f273c4284
commit 02f90d58f4
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -147,23 +147,22 @@ echo "*** uBOLite.$PLATFORM: extension ready"
echo "Extension location: $UBOL_DIR/"
# Local build
tmp_manifest=$(mktemp)
chmod '=rw' "$tmp_manifest"
if [ -z "$TAGNAME" ]; then
TAGNAME="uBOLite_$(jq -r .version "$UBOL_DIR"/manifest.json)"
# Enable DNR rule debugging
tmp=$(mktemp)
jq '.permissions += ["declarativeNetRequestFeedback"]' \
"$UBOL_DIR/manifest.json" > "$tmp" \
&& mv "$tmp" "$UBOL_DIR/manifest.json"
"$UBOL_DIR/manifest.json" > "$tmp_manifest" \
&& mv "$tmp_manifest" "$UBOL_DIR/manifest.json"
# Use a different extension id than the official one
if [ "$PLATFORM" = "firefox" ]; then
tmp=$(mktemp)
jq '.browser_specific_settings.gecko.id = "uBOLite.dev@raymondhill.net"' "$UBOL_DIR/manifest.json" > "$tmp" \
&& mv "$tmp" "$UBOL_DIR/manifest.json"
jq '.browser_specific_settings.gecko.id = "uBOLite.dev@raymondhill.net"' "$UBOL_DIR/manifest.json" > "$tmp_manifest" \
&& mv "$tmp_manifest" "$UBOL_DIR/manifest.json"
fi
else
tmp=$(mktemp)
jq --arg version "${TAGNAME:8}" '.version = $version' "$UBOL_DIR/manifest.json" > "$tmp" \
&& mv "$tmp" "$UBOL_DIR/manifest.json"
jq --arg version "${TAGNAME:8}" '.version = $version' "$UBOL_DIR/manifest.json" > "$tmp_manifest" \
&& mv "$tmp_manifest" "$UBOL_DIR/manifest.json"
fi
# Platform-specific steps