gitmark 0.0.56 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/git-mark-list CHANGED
@@ -48,7 +48,7 @@ function renderCommit(commit, type) {
48
48
  canon = JSON.stringify(canon)
49
49
  var id = sha256(canon)
50
50
 
51
- console.log(canon)
51
+ // console.log(canon)
52
52
 
53
53
  // sign
54
54
 
@@ -95,6 +95,7 @@ function getPrivKey() {
95
95
 
96
96
  // INIT
97
97
  data.privkey = argv._[0] || getPrivKey() || data.privkey
98
+ data.count = argv.count
98
99
 
99
100
  var POINT = Buffer.from(data.privkey, 'hex')
100
101
 
@@ -119,7 +120,9 @@ var genesisCommit = {
119
120
  }
120
121
  // console.log('genesis', genesis)
121
122
  // console.log('genesisCommit', genesisCommit)
122
- renderCommit(genesisCommit, 'nostr')
123
+ if (!data.count) {
124
+ renderCommit(genesisCommit, 'nostr')
125
+ }
123
126
 
124
127
  // get commits
125
128
  const commits = gitlog(options)
@@ -130,6 +133,7 @@ if (commits.length === 1) {
130
133
 
131
134
  // traverse backwards
132
135
  // console.log('Genesis tx need not be verified\n')
136
+ var done = 0
133
137
  for (var i = commits.length - 1; i >= 0; i--) {
134
138
  var commit = {}
135
139
  commit.subject = commits[i].subject
@@ -172,7 +176,9 @@ for (var i = commits.length - 1; i >= 0; i--) {
172
176
  commit.verify = `https://gitmark.info/${commit.subject.split(/[: ]/)[1]}`
173
177
 
174
178
  renderCommit(commit, 'nostr')
179
+ done++
175
180
  // console.log(commit)
181
+ if (data.count && done >= data.count) break
176
182
  }
177
183
  }
178
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitmark",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "gitmark",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,10 @@
31
31
  "child_process": "^1.0.2",
32
32
  "fs": "^0.0.1-security",
33
33
  "gitlog": "^4.0.4",
34
+ "gitmark": "^0.0.56",
34
35
  "minimist": "^1.2.5",
35
36
  "sha256": "^0.2.0",
36
37
  "tiny-secp256k1": "^1.1.6",
37
38
  "ws": "^8.2.3"
38
39
  }
39
- }
40
+ }