Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"main": "src/background.js",
"scripts": {
"sync-version": "node -e \"const fs=require('fs'); const pkg=require('./package.json'); const m=require('./src/manifest.json'); if(m.version!==pkg.version){m.version=pkg.version; fs.writeFileSync('src/manifest.json', JSON.stringify(m,null,2)+'\\n'); console.log('✓ Updated manifest.json version to '+pkg.version)}else{console.log('✓ Version already in sync: '+pkg.version)}\"",
"sync-version": "node scripts/sync-version.mjs",
"build": "npm run sync-version && tsc && cp src/manifest.json dist/ && cp src/popup.html dist/ && cp -r src/icons dist/",
"package": "npm run build && web-ext build --source-dir=dist --artifacts-dir=. --filename=ipfs-quicklaunch-{version}.zip --overwrite-dest",
"start": "npm run build && web-ext run --source-dir=dist --target=chromium",
Expand Down
17 changes: 17 additions & 0 deletions scripts/sync-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

// Synchronizes the version in src/manifest.json with the version in package.json
import fs from 'fs';
import { readFileSync } from 'fs';

const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
const manifestPath = './src/manifest.json';
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));

if (manifest.version !== pkg.version) {
manifest.version = pkg.version;
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
console.log('✓ Updated manifest.json version to ' + pkg.version);
} else {
console.log('✓ manifest.json version already in sync with package.json: ' + pkg.version);
}
Loading