Skip to content

Commit

Permalink
feat: capture build stats
Browse files Browse the repository at this point in the history
  • Loading branch information
joshknopp committed Jan 21, 2024
1 parent fbadd5a commit 9aecc8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
dist
src/assets/build-data.json
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"name": "joshknopp",
"version": "1.0.1",
"scripts": {
"build": "npm run clean && npm run build:pug && npm run build:scss && npm run build:scripts && npm run build:assets",
"build": "npm run clean && npm run capture-build-data && npm run build:pug && npm run build:scss && npm run build:scripts && npm run build:assets",
"build:assets": "node scripts/build-assets.js",
"build:pug": "node scripts/build-pug.js",
"build:scripts": "node scripts/build-scripts.js",
"build:scss": "node scripts/build-scss.js",
"clean": "node scripts/clean.js",
"start": "npm run build && node scripts/start.js",
"start:debug": "npm run build && node scripts/start-debug.js"
"start:debug": "npm run build && node scripts/start-debug.js",
"capture-build-data": "bash scripts/capture-build-data.sh"
},
"description": "Josh's personal and professional site based on https://startbootstrap.com/",
"keywords": [
Expand Down
4 changes: 4 additions & 0 deletions scripts/capture-build-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "{" > src/assets/build-data.json
echo " \"commitHash\":\"$(git rev-parse HEAD)\"," >> src/assets/build-data.json
echo " \"buildTimestamp\":$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")" >> src/assets/build-data.json
echo "}" >> src/assets/build-data.json

0 comments on commit 9aecc8e

Please # to comment.