File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 "scripts" : {
44 "build" : " webpack --mode production && ts-node create-firefox-build.ts && ts-node create-zip-archives.ts" ,
55 "lint" : " eslint src --ext ts,tsx" ,
6- "lint:fix" : " eslint src --ext ts,tsx --fix"
6+ "lint:fix" : " eslint src --ext ts,tsx --fix" ,
7+ "bump" : " node scripts/bump.js"
78 },
89 "devDependencies" : {
910 "@pmmmwh/react-refresh-webpack-plugin" : " 0.6.1" ,
Original file line number Diff line number Diff line change 1+ const fs = require ( 'fs' )
2+ const path = require ( 'path' )
3+ const { execSync } = require ( 'child_process' )
4+
5+ const manifest_path = path . resolve ( __dirname , '../src/manifest.json' )
6+ const manifest = JSON . parse ( fs . readFileSync ( manifest_path , 'utf-8' ) )
7+
8+ const date = new Date ( )
9+ const year = date . getFullYear ( )
10+ const month = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , '0' )
11+ const day = String ( date . getDate ( ) ) . padStart ( 2 , '0' )
12+ const date_prefix = `${ year } .${ month } ${ day } `
13+
14+ const version_parts = manifest . version . split ( '.' )
15+ const last_segment = parseInt ( version_parts . pop ( ) , 10 ) || 0
16+
17+ const next_segment = last_segment + 1
18+ manifest . version = `${ date_prefix } .${ next_segment } `
19+
20+ fs . writeFileSync ( manifest_path , JSON . stringify ( manifest , null , 2 ) + '\n' )
21+ console . log ( `Bumped version to ${ manifest . version } ` )
22+
23+ try {
24+ execSync ( `git add "${ manifest_path } "` , { stdio : 'ignore' } )
25+ execSync ( `git commit --no-verify -m "Bump version to ${ manifest . version } "` , { stdio : 'ignore' } )
26+ console . log ( 'Successfully committed the version bump.' )
27+ } catch ( error ) {
28+ console . error ( 'Failed to commit version bump:' , error . message )
29+ }
You can’t perform that action at this time.
0 commit comments