Skip to content

Commit

Permalink
AuthorHours.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 20, 2024
1 parent 22a30c8 commit 54fe977
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions AuthorHours.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"time":"479h6m27s"}
1 change: 1 addition & 0 deletions AuthorHours.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
From "2018-02-01" to "today" : 479h6m27s
14 changes: 14 additions & 0 deletions hourstxtToJSON.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* global require */
/* global process */
const fs = require("fs");
const path = require("path");

// open AuthorHours.txt and write time into JSON file

const hours = fs.readFileSync("AuthorHours.txt", "utf8");
console.log(hours.split("\n")[0].split(": ")[1]);
const json = { time: hours.split("\n")[0].split(": ")[1] };

fs.writeFile("AuthorHours.json", JSON.stringify(json), "utf8", function (err) {
if (err) return console.log(err);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint": "web-ext lint",
"esLint": "npx eslint firefox/ chrome/",
"test": "cd firefox && web-ext build --overwrite-dest && cd .. && node refreshXPI.js && python test.py",
"hours": "git hours -since 2018-02-01 -before today -author Marvin Alexander Krebber"
"hours": "git hours -since 2018-02-01 -before today -author [email protected] > AuthorHours.txt && node hourstxtToJSON.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 54fe977

Please sign in to comment.