Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding more details to stats

  • Loading branch information...
commit ba2f07a3f62e3b2a356849ee696432e650461037 1 parent 5ef1abf
Josh Perez authored September 08, 2011
2  .data.json
... ...
@@ -1 +1 @@
1  
-{"push":3,"st":2,"init":1,"add":1}
  1
+{"st":[{"date":1315495479583,"details":[]}],"add":[{"date":1315495495100,"details":["."]}]}
7  Makefile
... ...
@@ -0,0 +1,7 @@
  1
+all: uninstall install
  2
+
  3
+#install:
  4
+#	@npm install -g
  5
+#
  6
+#uninstall:
  7
+#	@npm uninstall git-stats -g
11  lib/stats.js
@@ -22,12 +22,15 @@ const stats = function (args) {
22 22
 
23 23
   var command = args.shift();
24 24
 
25  
-  if (data.stats.hasOwnProperty(command)) {
26  
-    data.stats[command] += 1;
27  
-  } else {
28  
-    data.stats[command] = 1;
  25
+  if (!data.stats.hasOwnProperty(command)) {
  26
+    data.stats[command] = [];
29 27
   }
30 28
 
  29
+  data.stats[command].push({
  30
+    date: Date.now(),
  31
+    details: args
  32
+  });
  33
+
31 34
   data.write();
32 35
 };
33 36
 
30  package.json
... ...
@@ -0,0 +1,30 @@
  1
+{
  2
+  "name": "git-stats",
  3
+  "author": "Josh Perez <josh@goatslacker.com>",
  4
+  "version": "0.0.1",
  5
+  "description": "Git statistics for you",
  6
+
  7
+  "keywords": [
  8
+    "git",
  9
+    "stats",
  10
+    "statistics",
  11
+    "scrobbling"
  12
+  ],
  13
+
  14
+  "repository": {
  15
+    "type": "git",
  16
+    "url": "https://github.com/goatslacker/git-stats.git"
  17
+  },
  18
+
  19
+  "preferGlobal": true,
  20
+
  21
+  "licenses": ["MIT"],
  22
+
  23
+  "bin": {
  24
+    "git-stats": "./bin/git-stats"
  25
+  },
  26
+
  27
+  "engines": {
  28
+    "node": ">= 0.4.0"
  29
+  }
  30
+}

0 notes on commit ba2f07a

Please sign in to comment.
Something went wrong with that request. Please try again.