gitmark 0.0.44 → 0.0.46
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 +1 -1
- package/bin/git-mark-init +8 -0
- package/bin/git-mark-verify +5 -5
- package/gitmark.json +7 -0
- package/package.json +1 -1
package/bin/git-mark
CHANGED
|
@@ -107,7 +107,7 @@ data.genesis = argv.genesis || data.genesis
|
|
|
107
107
|
console.log('data', data)
|
|
108
108
|
|
|
109
109
|
var lastCommit = commits.filter(i => {
|
|
110
|
-
return i.subject.match(/^gitmark/)
|
|
110
|
+
return i.subject.match(/^gitmark[ :][A-Fa-f0-9]/)
|
|
111
111
|
})
|
|
112
112
|
if (lastCommit && lastCommit[0] && lastCommit[0].subject) {
|
|
113
113
|
lastCommit = lastCommit[0].subject
|
package/bin/git-mark-init
CHANGED
|
@@ -139,6 +139,14 @@ console.log('tx', tx)
|
|
|
139
139
|
|
|
140
140
|
// create gitmark.json
|
|
141
141
|
console.log('create gitmark.json and check in files')
|
|
142
|
+
console.log(`{
|
|
143
|
+
"@id": "gitmark:${tx}:1",
|
|
144
|
+
"genesis": "gitmark:${tx}:1",
|
|
145
|
+
"nick": "gitmark",
|
|
146
|
+
"package": "./package.json",
|
|
147
|
+
"repository": "./"
|
|
148
|
+
}`)
|
|
149
|
+
|
|
142
150
|
|
|
143
151
|
// git mark genesis
|
|
144
152
|
console.log('git mark --genesis ', tx)
|
package/bin/git-mark-verify
CHANGED
|
@@ -38,7 +38,7 @@ const options = {
|
|
|
38
38
|
fields: ['hash', 'subject']
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function getPrivKey
|
|
41
|
+
function getPrivKey() {
|
|
42
42
|
try {
|
|
43
43
|
const fetchHeadDir = './.git/'
|
|
44
44
|
var fetchHeadFile = fetchHeadDir + 'FETCH_HEAD'
|
|
@@ -82,9 +82,9 @@ if (commits.length === 1) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
console.log('Genesis tx need not be verified\n')
|
|
85
|
-
for (var i = commits.length-1; i >= 0; i--) {
|
|
85
|
+
for (var i = commits.length - 1; i >= 0; i--) {
|
|
86
86
|
var subject = commits[i].subject
|
|
87
|
-
if (subject.match(/^gitmark/)) {
|
|
87
|
+
if (subject.match(/^gitmark[: ][A-Fa-f0-9]/)) {
|
|
88
88
|
var hash = commits[i + 1].hash
|
|
89
89
|
console.log()
|
|
90
90
|
console.log(subject)
|
|
@@ -106,8 +106,8 @@ for (var i = commits.length-1; i >= 0; i--) {
|
|
|
106
106
|
|
|
107
107
|
console.log(
|
|
108
108
|
'https://chainz.cryptoid.info/marks/tx.dws?' +
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
subject.split(' ')[1].split(':')[0] +
|
|
110
|
+
'.htm'
|
|
111
111
|
)
|
|
112
112
|
}
|
|
113
113
|
}
|
package/gitmark.json
ADDED