gitmark 0.0.65 → 0.0.68
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-init +1 -0
- package/bin/git-mark-list +12 -4
- package/package.json +2 -2
package/bin/git-mark-init
CHANGED
package/bin/git-mark-list
CHANGED
|
@@ -84,6 +84,7 @@ function addCryptoToCommit(commit) {
|
|
|
84
84
|
function renderCommit(commit, type) {
|
|
85
85
|
if (!commit) return
|
|
86
86
|
commit.tags = commit.tags || []
|
|
87
|
+
if (commit.c) commit.tags.push(["c", commit.c])
|
|
87
88
|
if (type === 'nostr') {
|
|
88
89
|
var canon = [0, commit.pubkey, commit.authorDate, 17, commit.tags, commit.hash]
|
|
89
90
|
|
|
@@ -139,6 +140,8 @@ function getPrivKey() {
|
|
|
139
140
|
data.privkey = argv._[0] || getPrivKey() || data.privkey
|
|
140
141
|
data.g = argv.g
|
|
141
142
|
data.count = argv.count
|
|
143
|
+
data.genesis = argv.genesis
|
|
144
|
+
data.created_at = argv.created
|
|
142
145
|
|
|
143
146
|
var POINT = Buffer.from(data.privkey, 'hex')
|
|
144
147
|
|
|
@@ -154,11 +157,11 @@ var b3
|
|
|
154
157
|
|
|
155
158
|
|
|
156
159
|
// genesis
|
|
157
|
-
var genesis = require('../gitmark.json')
|
|
158
160
|
var genesisCommit = {
|
|
159
161
|
"hash": "genesis",
|
|
160
|
-
"authorDate":
|
|
161
|
-
"privkey": b1.toString(16)
|
|
162
|
+
"authorDate": data.created_at,
|
|
163
|
+
"privkey": b1.toString(16),
|
|
164
|
+
"c": data.genesis,
|
|
162
165
|
}
|
|
163
166
|
var keyPair1 = bitcoin.ECPair.fromPrivateKey(
|
|
164
167
|
Buffer.from(b1.toString(16), 'hex'),
|
|
@@ -197,8 +200,13 @@ for (var i = commits.length - 1; i >= 0; i--) {
|
|
|
197
200
|
hash: commits[i + 1]?.hash,
|
|
198
201
|
subject: commits[i].subject,
|
|
199
202
|
authorDate: Math.floor(new Date(commits[i].authorDate).getTime() / 1000),
|
|
200
|
-
privkey: b1.toString(16)
|
|
203
|
+
privkey: b1.toString(16),
|
|
204
|
+
c: commits[i].subject
|
|
201
205
|
}
|
|
206
|
+
if (commit.c && commit.c.split(":").length <= 2) {
|
|
207
|
+
commit.c = commit.c + ':0'
|
|
208
|
+
}
|
|
209
|
+
commit.c = commit?.c?.replace('gitmark ', 'gitmark:')
|
|
202
210
|
commit = addCryptoToCommit(commit)
|
|
203
211
|
// console.log(commit)
|
|
204
212
|
gitmarks.push(commit)
|