diff --git a/package.json b/package.json index 104a538..161b6a0 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "protonfox", - "version": "0.1.0", + "version": "0.2.0", "description": "Displays information about game compatibility with Proton on Steam.", "main": "index.js", "type": "module", "scripts": { - "build": "webpack --mode production && cp src/manifest.json dist/" + "build": "webpack --mode production && node scripts/manifest.cjs" }, "keywords": [], "author": "mxgic1337_", diff --git a/scripts/manifest.cjs b/scripts/manifest.cjs new file mode 100644 index 0000000..dfbf30f --- /dev/null +++ b/scripts/manifest.cjs @@ -0,0 +1,13 @@ +const fs = require('node:fs') +const path = require('path') + +const packageJsonContent = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json')).toString()) + +const manifestPath = path.join(__dirname, '..', 'src', 'manifest.json') +const manifestDistPath = path.join(__dirname, '..', 'dist', 'manifest.json') + +let manifestContent = fs.readFileSync(manifestPath).toString(); +manifestContent = manifestContent.replaceAll('{{ version }}', packageJsonContent.version); +manifestContent = manifestContent.replaceAll('{{ description }}', packageJsonContent.description); + +fs.writeFileSync(manifestDistPath, manifestContent) \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index a5f5a86..3b470b3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, "name": "Protonfox", - "version": "0.1.0", - "description": "Displays information about game compatibility with Proton on Steam.", + "version": "{{ version }}", + "description": "{{ description }}", "content_scripts": [ { "matches": [