build: postversion command

This commit is contained in:
EnixCoda 2018-09-15 22:00:28 +08:00
parent 48e213a158
commit cd5b9836ce
3 changed files with 30 additions and 5 deletions

View file

@ -8,9 +8,9 @@
"private": true,
"scripts": {
"start": "webpack --watch",
"dev": "webpack",
"stamp": "node scripts/version.js",
"prod": "NODE_ENV=production webpack && cd dist && rm -f ./gitako.zip && zip gitako.zip -r *"
"postversion": "npm run stamp && git add src/manifest.json && git commit --amend --no-edit",
"prod": "npm run stamp && NODE_ENV=production webpack && cd dist && rm -f ./gitako.zip && zip gitako.zip -r *"
},
"dependencies": {
"nprogress": "^0.2.0",

View file

@ -3,8 +3,8 @@ const path = require('path')
const rootPath = path.resolve(__dirname, '../')
const packageJSON = require(path.resolve(rootPath, 'package.json'))
const manifestPath = path.resolve(rootPath, 'src/manifest.json');
const manifestPath = path.resolve(rootPath, 'src/manifest.json')
const manifest = require(manifestPath)
manifest.version = packageJSON.version
fs.writeFileSync(manifestPath, JSON.stringify(manifest), 'utf-8')
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, ' '), 'utf-8')

View file

@ -1 +1,26 @@
{"manifest_version":2,"name":"Gitako","version":"0.3.0","author":"EnixCoda","icons":{"128":"icons/Gitako-128x128.png"},"description":"yet another GitHub extension, inspired by Octotree and GayHub.","homepage_url":"https://github.com/EnixCoda/Gitako","permissions":["tabs","storage","*://github.com/*"],"content_scripts":[{"matches":["https://github.com/*"],"js":["content.js"]}]}
{
"manifest_version": 2,
"name": "Gitako",
"version": "0.3.0",
"author": "EnixCoda",
"icons": {
"128": "icons/Gitako-128x128.png"
},
"description": "yet another GitHub extension, inspired by Octotree and GayHub.",
"homepage_url": "https://github.com/EnixCoda/Gitako",
"permissions": [
"tabs",
"storage",
"*://github.com/*"
],
"content_scripts": [
{
"matches": [
"https://github.com/*"
],
"js": [
"content.js"
]
}
]
}