File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 2626strip_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
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const srcContent = fs.readFileSync(MANIFEST_SRC, 'utf8');
3434const json = JSON . parse ( srcContent ) ;
3535const permissions = new Set ( json . permissions ) ;
3636
37- const extVer = json . version ;
37+ let extVer = json . version ;
3838const FIREFOX_UPDATE_URL = "https://secure.informaction.com/update/?v=" + extVer ;
3939const 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 ;
You can’t perform that action at this time.
0 commit comments