Skip to content

Commit

Permalink
feat(schema): Add disable property to checkver and autoupdate (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 authored Mar 7, 2021
1 parent 409da27 commit 9090c5a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- **decompress**: Support `INNOSETUP_USE_INNOEXTRACT` config option and `Expand-InnoArchive -UseInnoextract`
- **format**: Extract checkver fixes into own function and add generic adjust property function
- **schema**
- Add `disable` property to `checkver` and `autoupdate`
- Remove deprecated short properties
- Cleanup descriptions
- Remove deprecated functions from code-base
Expand Down
13 changes: 12 additions & 1 deletion bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ function Invoke-Check {
if ($ForceUpdate) { $Update = $true }

if ($Update -and $json.autoupdate) {
if ($json.autoupdate.disable -and ($json.autoupdate.disable -eq $true)) {
Write-UserMessage "${appName}: Skipping disabled autoupdate" -Info
return
}

if ($ForceUpdate) { Write-UserMessage -Message 'Forcing autoupdate!' -Color 'DarkMagenta' }
if ($Version -ne '') { $ver = $Version }

Expand Down Expand Up @@ -232,7 +237,13 @@ foreach ($ff in Get-ChildItem $Dir "$Search.*" -File) {
Write-UserMessage -Message "Invalid manifest: $($ff.Name)" -Err
continue
}
if ($m.checkver) { $Queue += , @($ff, $m) }
if ($m.checkver) {
if ($m.checkver.disable -and ($m.checkver.disable -eq $true)) {
Write-UserMessage "$($ff.BaseName): Skipping disabled checkver" -Info
continue
}
$Queue += , @($ff, $m)
}
}

foreach ($q in $Queue) {
Expand Down
8 changes: 8 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@
"script": {
"description": "Specifies custom PowerShell commands to retrieve latest version.",
"$ref": "#/definitions/stringOrArrayOfStrings"
},
"disable": {
"description": "Specifies to not execute checkver script without deleting whole property.",
"type": "boolean"
}
}
}
Expand Down Expand Up @@ -431,6 +435,10 @@
"extract_dir": {
"description": "Specifies to update 'extract_dir' property.",
"type": "string"
},
"disable": {
"description": "Specifies to prevent autoupdating of manifest without deleting whole property.",
"type": "boolean"
}
}
}
Expand Down

0 comments on commit 9090c5a

Please sign in to comment.