Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

- `Deploy-NovaPackage` now shows a concise resolved-upload summary before execution, reports progress while multiple artifacts are uploading, and prints a short completion summary with a suggested verification step after successful raw uploads.
- `Get-NovaProjectInfo` now fails with clearer recovery guidance when `-Path` does not exist, points to a file, or the target folder is missing `project.json`.
- `Get-NovaUpdateNotificationPreference -Verbose` now explains whether Nova is reading a stored preference or the built-in default, and the command help now points read-only PowerShell users to the matching `% nova notification` workflow.

### Deprecated

Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This file summarizes the release notes for NovaModuleTools. **UNRELEASED** chang

- `Deploy-NovaPackage` now shows clearer terminal feedback during raw package uploads, including a concise pre-flight summary, progress across multiple artifacts, and a short verification hint after success.
- `Get-NovaProjectInfo` now explains how to recover when `-Path` is invalid or the target folder is not a Nova project root.
- `Get-NovaUpdateNotificationPreference -Verbose` now tells you whether Nova is using a stored update-notification preference or the built-in default, and the help now points to the matching `% nova notification` workflow.

### Deprecated

Expand Down
18 changes: 18 additions & 0 deletions docs/NovaModuleTools/en-US/Get-NovaUpdateNotificationPreference.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ The same stored preference is also used by `Update-NovaModuleTool` (alias: `Upda

Stable self-updates remain available and do not require prerelease eligibility.

If no settings file exists yet, the command reports the default behavior: prerelease self-updates are enabled and
stable self-updates remain available.

Use `% nova notification` when you want the CLI-oriented view of the same preference.

## EXAMPLES

### EXAMPLE 1
Expand All @@ -44,6 +49,15 @@ Shows whether prerelease self-updates are currently enabled, whether stable self

### EXAMPLE 2

```text
PS> Get-NovaUpdateNotificationPreference -Verbose
```

Shows the current status and writes a short explanation that tells you whether Nova is using a stored settings file
or the built-in default.

### EXAMPLE 3

```text
PS> Set-NovaUpdateNotificationPreference -DisablePrereleaseNotifications
PS> Get-NovaUpdateNotificationPreference
Expand Down Expand Up @@ -77,10 +91,14 @@ Use `Set-NovaUpdateNotificationPreference -DisablePrereleaseNotifications` to st

Use `Set-NovaUpdateNotificationPreference -EnablePrereleaseNotifications` to allow prerelease self-updates again.

Use `-Verbose` when you want a short explanation of whether Nova is reading a stored preference or falling back to
the default.

When prerelease notifications are enabled again, `Update-NovaModuleTool` / `Update-NovaModuleTools` may again select a prerelease target. Prerelease self-updates still require explicit confirmation before the update proceeds, and that confirmation defaults to `No` so pressing Enter cancels the update.

## RELATED LINKS

- [Invoke-NovaBuild](./Invoke-NovaBuild.md)
- [Set-NovaUpdateNotificationPreference](./Set-NovaUpdateNotificationPreference.md)
- [Install-NovaCli](./Install-NovaCli.md)
- [Update-NovaModuleTool](./Update-NovaModuleTools.md)
38 changes: 36 additions & 2 deletions src/private/update/GetNovaUpdateNotificationPreferenceStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,44 @@ function Get-NovaUpdateNotificationPreferenceStatus {
param()

$preference = Read-NovaUpdateNotificationPreference
$settingsPath = Get-NovaUpdateSettingsFilePath
$settingsFileExists = Test-Path -LiteralPath $settingsPath -PathType Leaf

return [pscustomobject]@{
$status = [pscustomobject]@{
PrereleaseNotificationsEnabled = $preference.PrereleaseNotificationsEnabled
StableReleaseNotificationsEnabled = $true
SettingsPath = Get-NovaUpdateSettingsFilePath
SettingsPath = $settingsPath
}

Write-NovaUpdateNotificationPreferenceStatusVerbose -Status $status -SettingsFileExists:$settingsFileExists
return $status
}

function Write-NovaUpdateNotificationPreferenceStatusVerbose {
[CmdletBinding()]
param(
[Parameter(Mandatory)][pscustomobject]$Status,
[Parameter(Mandatory)][bool]$SettingsFileExists
)

$prereleaseState = Get-NovaUpdateNotificationPreferenceStateText -Enabled:$Status.PrereleaseNotificationsEnabled
if ($SettingsFileExists) {
Write-Verbose "Prerelease self-updates are $prereleaseState. Stable self-updates remain available. Settings file: $( $Status.SettingsPath )"
return
}

Write-Verbose "No settings file was found at $( $Status.SettingsPath ). Using the default setting: prerelease self-updates are $prereleaseState. Stable self-updates remain available. Use Set-NovaUpdateNotificationPreference to store a different preference."
}

function Get-NovaUpdateNotificationPreferenceStateText {
[CmdletBinding()]
param(
[Parameter(Mandatory)][bool]$Enabled
)

if ($Enabled) {
return 'enabled'
}

return 'disabled'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,31 @@ Describe 'Get-NovaUpdateNotificationPreferenceStatus' {
It 'returns the stored preference along with the settings file path' {
Mock Read-NovaUpdateNotificationPreference {return [pscustomobject]@{PrereleaseNotificationsEnabled = $false}}
Mock Get-NovaUpdateSettingsFilePath {return '/some/path/settings.json'}
Mock Test-Path {return $true}
Mock Write-Verbose {}

$status = Get-NovaUpdateNotificationPreferenceStatus

$status.PrereleaseNotificationsEnabled | Should -BeFalse
$status.StableReleaseNotificationsEnabled | Should -BeTrue
$status.SettingsPath | Should -Be '/some/path/settings.json'
Assert-MockCalled Write-Verbose -Times 1 -ParameterFilter {
$Message -eq 'Prerelease self-updates are disabled. Stable self-updates remain available. Settings file: /some/path/settings.json'
}
}

It 'explains when the default preference is being used because the settings file is missing' {
Mock Read-NovaUpdateNotificationPreference {return [pscustomobject]@{PrereleaseNotificationsEnabled = $true}}
Mock Get-NovaUpdateSettingsFilePath {return '/some/path/settings.json'}
Mock Test-Path {return $false}
Mock Write-Verbose {}

$status = Get-NovaUpdateNotificationPreferenceStatus

$status.PrereleaseNotificationsEnabled | Should -BeTrue
$status.SettingsPath | Should -Be '/some/path/settings.json'
Assert-MockCalled Write-Verbose -Times 1 -ParameterFilter {
$Message -eq 'No settings file was found at /some/path/settings.json. Using the default setting: prerelease self-updates are enabled. Stable self-updates remain available. Use Set-NovaUpdateNotificationPreference to store a different preference.'
}
}
}
Loading