Skip to content

Commit c12dfa7

Browse files
committed
Switch Firefox development build version format to *.9xx (like Chromium).
1 parent 4600b5d commit c12dfa7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ fi
2626
strip_rc_ver() {
2727
MANIFEST="$1"
2828
if [[ "$2" == "rel" ]]; then
29-
replace='s/("version":.*)rc\d+/$1/'
29+
# release: truncate alpha/beta/rc suffixes (or *.9xx with increment)
30+
replace='s/("version":.*)[a-z]+\d+/$1/, s/("version":.*)\b(\d+)\.9\d{2}/{ $1 . ($2 + 1) }/e'
3031
else
31-
replace='s/("version":.*?)(\d+)rc(\d+)/{$1 . ($2 == "0" ? "0" : ($2-1) . ".9" . sprintf("%03d", $3))}/e'
32+
# turn alpha/beta/rc format into *.9xx with decrement
33+
replace='s/("version":.*?)\b(\d+)(?:\.0)*[a-z]+(\d+)/{ $1 . ($2 - 1) . "." . (900 + $3) }/e'
3234
fi
3335
perl -pi.bak -e "$replace" "$MANIFEST" && rm -f "$MANIFEST".bak
3436
}
@@ -80,7 +82,7 @@ if [[ "$1" == "bump" ]]; then
8082
echo "Bumping to $VER"
8183
git add "$MANIFEST_IN"
8284
git commit -m "Version bump: $VER."
83-
if ! ([[ $VER == *rc* ]] || [[ $VER =~ \.9[0-9][09]$ ]]); then
85+
if ! ([[ $VER == *rc* ]] || [[ $VER =~ \.9[0-9][0-9]$ ]]); then
8486
# it's a stable release: let's lock nscl and tag
8587
git submodule update
8688
"$0" tag

manifest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const srcContent = fs.readFileSync(MANIFEST_SRC, 'utf8');
3434
const json = JSON.parse(srcContent);
3535
const permissions = new Set(json.permissions);
3636

37-
const extVer = json.version;
37+
let extVer = json.version;
3838
const FIREFOX_UPDATE_URL = "https://secure.informaction.com/update/?v=" + extVer;
3939
const EDGE_UPDATE_URL = "https://edge.microsoft.com/extensionwebstorebase/v1/crx";
4040

@@ -48,6 +48,9 @@ if (MANIFEST_VER.includes(3)) {
4848
// MV3
4949
json.manifest_version = 3;
5050
if (!isFirefox) {
51+
// convert ${ver}(a|b|rc)xx into ${ver--}.9xx
52+
json.version = extVer.replace(/(\d+)(?:\.0)*[a-z]+(\d+)$/,
53+
(all, maj, min) => `${parseInt(maj) - 1}.${900 + parseInt(min)}`);
5154
delete json.browser_specific_settings;
5255
delete json.content_security_policy;
5356
const {scripts} = json.background;

0 commit comments

Comments
 (0)