Skip to content

Commit

Permalink
Made it so that the script tells you that there's no update when ther…
Browse files Browse the repository at this point in the history
…e's no update when executing the script with the $checkForBWCliUpdate flag.
  • Loading branch information
trparky committed Aug 27, 2024
1 parent e4247f3 commit 8b9296d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Export-Bitwarden.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Export-Bitwarden.psm1'

# Version number of this module.
ModuleVersion = '1.44'
ModuleVersion = '1.45'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
11 changes: 8 additions & 3 deletions Export-Bitwarden.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Export-Bitwarden { # Don't touch this line!
# == WARNING!!! DO NOT TOUCH ANYTHING BELOW THIS!!! ==
# ====================================================

$ver = "1.44"
$ver = "1.45"

Write-Host -ForegroundColor Green "========================================================================================"
Write-Host -ForegroundColor Green "== Bitwarden Vault Export Script v$ver =="
Expand Down Expand Up @@ -176,18 +176,23 @@ function Export-Bitwarden { # Don't touch this line!
if (($checkForBWCliUpdate) -and (($forcebwcliupdate) -or (ShouldWeCheckForABWCLIUpdate))) {
if ($forcebwcliupdate) {
Write-Host -ForegroundColor Green "Notice:" -NoNewLine
Write-Host " Script executed with ForceBWCliUpdate flag."
Write-Host ""
Write-Host " Script executed with ForceBWCliUpdate flag." -NoNewLine
}

$localBWCliVersion = ((& $bwCliBinName --version) | Out-String).Trim()
$remoteBWCliVersion = (Invoke-WebRequest -Uri "https://trparky.github.io/bwcliversion.txt").Content.Trim()

if ($localBWCliVersion -ne $remoteBWCliVersion) {
Write-Host ""
Write-Host ""
Write-Host "Bitwarden CLI application update found, downloading... Please Wait." -NoNewLine
Remove-Item -Path $bwCliBinName
DownloadBWCli
}
else {
Write-Host " No update found."
Write-Host ""
}
}
}

Expand Down

0 comments on commit 8b9296d

Please sign in to comment.