Skip to content

Commit 76fdb6b

Browse files
committed
checkver: add 'jsonpath' alias for 'jp'
1 parent 468649c commit 76fdb6b

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

bin/checkver.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ $queue | ForEach-Object {
8686
if($json.checkver.jp) {
8787
$jsonpath = $json.checkver.jp
8888
}
89+
if($json.checkver.jsonpath) {
90+
$jsonpath = $json.checkver.jsonpath
91+
}
8992

9093
if ($json.checkver.replace -and $json.checkver.replace.GetType() -eq [System.String]) {
9194
$replace = $json.checkver.replace

lib/autoupdate.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
159159
$hashmode = 'extract'
160160
}
161161

162-
if ($config.jp.Length -gt 0) {
162+
$jsonpath = ''
163+
if ($config.jp) {
164+
$jsonpath = $config.jp
165+
$hashmode = 'json'
166+
}
167+
if ($config.jsonpath) {
168+
$jsonpath = $config.jsonpath
163169
$hashmode = 'json'
164170
}
165171

@@ -175,7 +181,7 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
175181
$hash = find_hash_in_textfile $hashfile_url $basename $config.find
176182
}
177183
'json' {
178-
$hash = find_hash_in_json $hashfile_url $basename $config.jp
184+
$hash = find_hash_in_json $hashfile_url $basename $jsonpath
179185
}
180186
'rdf' {
181187
$hash = find_hash_in_rdf $hashfile_url $basename

schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"type": "string"
3131
},
3232
"jp": {
33+
"pattern": "^\\$\\..*$",
34+
"type": "string",
35+
"description": "Same as 'jsonpath'"
36+
},
37+
"jsonpath": {
3338
"pattern": "^\\$\\..*$",
3439
"type": "string"
3540
},
@@ -216,6 +221,11 @@
216221
"type": "string"
217222
},
218223
"jp": {
224+
"pattern": "^\\$\\..*$",
225+
"type": "string",
226+
"description": "Same as 'jsonpath'"
227+
},
228+
"jsonpath": {
219229
"pattern": "^\\$\\..*$",
220230
"type": "string"
221231
},

0 commit comments

Comments
 (0)