Skip to content

Commit

Permalink
chore: updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
mxgic1337 committed Jan 8, 2025
1 parent a4926fb commit 8c4387e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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_",
Expand Down
13 changes: 13 additions & 0 deletions scripts/manifest.cjs
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 8c4387e

Please sign in to comment.