Skip to content

Commit

Permalink
fix metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed May 28, 2020
1 parent 71c0d20 commit fdd067f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"build": "npm run clean && npm run build:tsc && npm run build:dist",
"build:tsc": "tsc --sourceMap",
"build:metadata": "./scripts/get-metadata.js > src/metadata.json",
"build:dist": "cross-env NODE_ENV=production webpack",
"clean": "rm -rf ./dist/ ./doc/ ./.nyc_output",
"lint": "eslint --ignore-path .gitignore --ext .ts,.tsx .",
Expand Down
19 changes: 19 additions & 0 deletions scripts/get-metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env node
'use strict'

const packageInfo = require('../package.json')

const execSync = require('child_process').execSync

process.stdout.write(
JSON.stringify(
{
version: require('../package.json').version,
commit: execSync(`git rev-parse HEAD`)
.toString()
.trim()
},
null,
' '
)
)

0 comments on commit fdd067f

Please sign in to comment.