mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2026-08-24 10:14:12 -05:00
chore(windows): remove MSI
Entire-Checkpoint: a15c30369ec4
This commit is contained in:
committed by
Jan De Dobbeleer
parent
4ea80d1e39
commit
553093727d
@@ -1,25 +0,0 @@
|
|||||||
name: Delete Store Submission
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
delete_submission:
|
|
||||||
name: Delete Store Submission
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Configure Store Credentials 🔑
|
|
||||||
uses: jandedobbeleer/store-submission@submission-status
|
|
||||||
with:
|
|
||||||
command: configure
|
|
||||||
type: win32
|
|
||||||
seller-id: ${{ secrets.SELLER_ID }}
|
|
||||||
product-id: ${{ secrets.PRODUCT_ID }}
|
|
||||||
tenant-id: ${{ secrets.TENANT_ID }}
|
|
||||||
client-id: ${{ secrets.CLIENT_ID }}
|
|
||||||
client-secret: ${{ secrets.CLIENT_SECRET }}
|
|
||||||
|
|
||||||
- name: Delete Submission 🗑️
|
|
||||||
uses: jandedobbeleer/store-submission@submission-status
|
|
||||||
with:
|
|
||||||
command: delete
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
name: Windows Store
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
microsoft_store:
|
|
||||||
name: Publish To Windows Store
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Configure Store Credentials 🔑
|
|
||||||
uses: jandedobbeleer/store-submission@submission-status
|
|
||||||
with:
|
|
||||||
command: configure
|
|
||||||
type: win32
|
|
||||||
seller-id: ${{ secrets.SELLER_ID }}
|
|
||||||
product-id: ${{ secrets.PRODUCT_ID }}
|
|
||||||
tenant-id: ${{ secrets.TENANT_ID }}
|
|
||||||
client-id: ${{ secrets.CLIENT_ID }}
|
|
||||||
client-secret: ${{ secrets.CLIENT_SECRET }}
|
|
||||||
only-on-ready: true
|
|
||||||
- name: Update draft submission
|
|
||||||
uses: jandedobbeleer/store-submission@submission-status
|
|
||||||
with:
|
|
||||||
command: update
|
|
||||||
product-update: '{
|
|
||||||
"packages":[
|
|
||||||
{
|
|
||||||
"packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/${{ github.event.release.tag_name }}/install-x64.msi",
|
|
||||||
"languages":["en"],
|
|
||||||
"architectures":["X64"],
|
|
||||||
"installerParameters":"/quiet INSTALLER=ws",
|
|
||||||
"isSilentInstall":false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/${{ github.event.release.tag_name }}/install-arm64.msi",
|
|
||||||
"languages":["en"],
|
|
||||||
"architectures":["Arm64"],
|
|
||||||
"installerParameters":"/quiet INSTALLER=ws",
|
|
||||||
"isSilentInstall":false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
- name: Publish Submission
|
|
||||||
uses: jandedobbeleer/store-submission@submission-status
|
|
||||||
with:
|
|
||||||
command: publish
|
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
src/dist/posh-*
|
src/dist/posh-*
|
||||||
src/dist/themes.*
|
src/dist/themes.*
|
||||||
src/dist/checksums.*
|
src/dist/checksums.*
|
||||||
msi:
|
msix:
|
||||||
needs:
|
needs:
|
||||||
- changelog
|
- changelog
|
||||||
- artifacts
|
- artifacts
|
||||||
@@ -102,7 +102,7 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
working-directory: ${{ github.workspace }}/packages/msi
|
working-directory: ${{ github.workspace }}/packages/msix
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code 👋
|
- name: Checkout code 👋
|
||||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
|
||||||
@@ -110,8 +110,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-artifacts
|
name: build-artifacts
|
||||||
path: dist
|
path: dist
|
||||||
- name: Install Wix Toolset 🛠
|
|
||||||
run: dotnet tool install --global wix
|
|
||||||
- name: Build installer 📦
|
- name: Build installer 📦
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
@@ -123,16 +121,15 @@ jobs:
|
|||||||
./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Copy -Sign -SDKVersion "10.0.26100.0"
|
./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Copy -Sign -SDKVersion "10.0.26100.0"
|
||||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
|
||||||
with:
|
with:
|
||||||
name: msi-artifact-${{ matrix.arch }}
|
name: msix-artifact-${{ matrix.arch }}
|
||||||
path: |
|
path: |
|
||||||
packages/msi/out/install-${{ matrix.arch }}.msi
|
packages/msix/out/install-${{ matrix.arch }}.msix
|
||||||
packages/msi/out/install-${{ matrix.arch }}.msix
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- changelog
|
- changelog
|
||||||
- artifacts
|
- artifacts
|
||||||
- msi
|
- msix
|
||||||
- android
|
- android
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
||||||
@@ -193,9 +190,7 @@ jobs:
|
|||||||
$version = $version.TrimStart('v')
|
$version = $version.TrimStart('v')
|
||||||
|
|
||||||
$urls = @(
|
$urls = @(
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msi|x64",
|
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msix|x64",
|
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msix|x64",
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msi|arm64",
|
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msix|arm64"
|
"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msix|arm64"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -14,8 +14,7 @@ apm_modules/
|
|||||||
src/test/umbraco/obj/
|
src/test/umbraco/obj/
|
||||||
src/keys
|
src/keys
|
||||||
*.prof
|
*.prof
|
||||||
*.wixpdb
|
packages/msix/Microsoft.Trusted.Signing.Client
|
||||||
packages/msi/Microsoft.Trusted.Signing.Client
|
|
||||||
.claude
|
.claude
|
||||||
.styles
|
.styles
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
# MSI Package
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
- [dotnet]
|
|
||||||
- [wix]: `dotnet tool install --global wix`
|
|
||||||
|
|
||||||
## Build the package
|
|
||||||
|
|
||||||
This guide assumes and advices the use of PowerShell as your shell environment for this purpose.
|
|
||||||
|
|
||||||
### Set the environment variables
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$env:VERSION = "1.3.37"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build the installer
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
wix build -arch arm64 -out install-arm64.msi
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install the package
|
|
||||||
|
|
||||||
### For the current user
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
install-arm64.msi
|
|
||||||
```
|
|
||||||
|
|
||||||
### For all users
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
install-arm64.msi ALLUSERS=1
|
|
||||||
```
|
|
||||||
|
|
||||||
[dotnet]: https://dotnet.microsoft.com/en-us/download/dotnet?cid=getdotnetcorecli
|
|
||||||
[wix]: https://wixtoolset.org/docs/intro/
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB |
@@ -1,44 +0,0 @@
|
|||||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
|
||||||
<Package Language="1033" Manufacturer="Jan De Dobbeleer" Name="Oh My Posh" UpgradeCode="b2a6bcaa-bda3-4c7f-8dec-d8665d7a9b69" Version="$(env.VERSION)" Scope="perUserOrMachine">
|
|
||||||
<SummaryInformation Description="https://ohmyposh.dev" />
|
|
||||||
<Icon Id="icon.ico" SourceFile="icon.ico" />
|
|
||||||
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
|
|
||||||
<Property Id="INSTALLER" Value="manual" />
|
|
||||||
<MediaTemplate EmbedCab="yes" />
|
|
||||||
<StandardDirectory Id="ProgramFilesFolder">
|
|
||||||
<Directory Id="ParentInstallDir" Name="oh-my-posh">
|
|
||||||
<Directory Id="INSTALLDIR" Name="bin" />
|
|
||||||
<Directory Id="THEMESDIR" Name="themes" />
|
|
||||||
</Directory>
|
|
||||||
</StandardDirectory>
|
|
||||||
<Feature Id="Installation" AllowAbsent="no" Description="https://ohmyposh.dev" Title="Oh My Posh">
|
|
||||||
<ComponentGroupRef Id="Files" />
|
|
||||||
<ComponentGroupRef Id="EnvironmentVariables" />
|
|
||||||
</Feature>
|
|
||||||
<InstallExecuteSequence>
|
|
||||||
<RemoveExistingProducts After="InstallValidate" />
|
|
||||||
</InstallExecuteSequence>
|
|
||||||
</Package>
|
|
||||||
<Fragment>
|
|
||||||
<ComponentGroup Id="Files">
|
|
||||||
<Component Id="Executable" Directory="INSTALLDIR">
|
|
||||||
<File Source="dist/oh-my-posh.exe" />
|
|
||||||
</Component>
|
|
||||||
<Files Directory="THEMESDIR" Include="../../themes/*.omp.*" />
|
|
||||||
</ComponentGroup>
|
|
||||||
</Fragment>
|
|
||||||
<Fragment>
|
|
||||||
<ComponentGroup Id="EnvironmentVariables">
|
|
||||||
<Component Id="SystemEnvironmentVariables" Condition="ALLUSERS=1" Directory="INSTALLDIR" Guid="ee903196-9032-4592-b461-25c96823bed7">
|
|
||||||
<Environment Id="SystemPath" Action="set" Name="Path" Part="first" Permanent="no" System="yes" Value="[INSTALLDIR]" />
|
|
||||||
<Environment Id="SystemThemesDir" Action="set" Name="POSH_THEMES_PATH" Part="all" Permanent="no" System="yes" Value="[THEMESDIR]" />
|
|
||||||
<Environment Id="SystemInstaller" Action="set" Name="POSH_INSTALLER" Part="all" Permanent="no" System="yes" Value="[INSTALLER]" />
|
|
||||||
</Component>
|
|
||||||
<Component Id="UserEnvironmentVariables" Condition="NOT ALLUSERS" Directory="INSTALLDIR" Guid="212dc904-b134-45b6-a647-a05ce417684a">
|
|
||||||
<Environment Id="UserPath" Action="set" Name="Path" Part="first" Permanent="no" System="no" Value="[INSTALLDIR]" />
|
|
||||||
<Environment Id="UserThemesDir" Action="set" Name="POSH_THEMES_PATH" Part="all" Permanent="no" System="no" Value="[THEMESDIR]" />
|
|
||||||
<Environment Id="UserInstaller" Action="set" Name="POSH_INSTALLER" Part="all" Permanent="no" System="no" Value="[INSTALLER]" />
|
|
||||||
</Component>
|
|
||||||
</ComponentGroup>
|
|
||||||
</Fragment>
|
|
||||||
</Wix>
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# MSIX Package
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- [Windows SDK] (provides `makeappx.exe` and `signtool.exe`)
|
||||||
|
|
||||||
|
## Build the package
|
||||||
|
|
||||||
|
This guide assumes and advises the use of PowerShell as your shell environment for this purpose.
|
||||||
|
|
||||||
|
Place the executable to package at `./dist/oh-my-posh.exe`, or use `-Copy` to take it from
|
||||||
|
the repository's `dist` folder.
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
./build.ps1 -Architecture x64 -Version "1.3.37"
|
||||||
|
```
|
||||||
|
|
||||||
|
The package is created at `out/install-x64.msix`.
|
||||||
|
|
||||||
|
## Install the package
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
Add-AppxPackage -Path ./out/install-x64.msix
|
||||||
|
```
|
||||||
|
|
||||||
|
[Windows SDK]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Builds MSI and MSIX packages for Oh My Posh.
|
Builds the MSIX package for Oh My Posh.
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script creates MSI and MSIX installer packages for Oh My Posh with the specified architecture and version.
|
This script creates the MSIX installer package for Oh My Posh with the specified architecture and version.
|
||||||
It can optionally copy the executable, sign the packages, and generate hash files for verification.
|
It can optionally copy the executable and sign the package.
|
||||||
|
|
||||||
.PARAMETER Architecture
|
.PARAMETER Architecture
|
||||||
The target architecture for the package. Must be either 'x64' or 'arm64'.
|
The target architecture for the package. Must be either 'x64' or 'arm64'.
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
The Windows SDK version to use for signing and packaging tools. Defaults to "10.0.26100.0".
|
The Windows SDK version to use for signing and packaging tools. Defaults to "10.0.26100.0".
|
||||||
|
|
||||||
.PARAMETER Sign
|
.PARAMETER Sign
|
||||||
When specified, signs the MSI and MSIX packages using Azure Code Signing.
|
When specified, signs the MSIX package using Azure Code Signing.
|
||||||
|
|
||||||
.PARAMETER Copy
|
.PARAMETER Copy
|
||||||
When specified, copies the appropriate executable from the dist folder before packaging.
|
When specified, copies the appropriate executable from the dist folder before packaging.
|
||||||
@@ -24,21 +24,18 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\build.ps1 -Architecture x64 -Version "1.2.3" -Copy
|
.\build.ps1 -Architecture x64 -Version "1.2.3" -Copy
|
||||||
|
|
||||||
Creates MSI and MSIX packages for x64 architecture with version 1.2.3, copying the executable first.
|
Creates the MSIX package for x64 architecture with version 1.2.3, copying the executable first.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\build.ps1 -Architecture arm64 -Version "1.2.3" -Sign -Copy
|
.\build.ps1 -Architecture arm64 -Version "1.2.3" -Sign -Copy
|
||||||
|
|
||||||
Creates and signs MSI and MSIX packages for arm64 architecture with version 1.2.3.
|
Creates and signs the MSIX package for arm64 architecture with version 1.2.3.
|
||||||
|
|
||||||
.OUTPUTS
|
.OUTPUTS
|
||||||
Creates the following files in the 'out' directory:
|
Creates install-{Architecture}.msix in the 'out' directory.
|
||||||
- install-{Architecture}.msi
|
|
||||||
- install-{Architecture}.msix
|
|
||||||
- Hash files (.sha256) for verification
|
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
Requires WiX toolset for MSI creation and Windows SDK for MSIX packaging and signing.
|
Requires the Windows SDK for MSIX packaging and signing.
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@@ -156,7 +153,7 @@ function Invoke-PackageSigning {
|
|||||||
|
|
||||||
#region Main Script
|
#region Main Script
|
||||||
|
|
||||||
Write-Verbose "Building MSI for $Architecture with version $Version" -Verbose
|
Write-Verbose "Building MSIX for $Architecture with version $Version" -Verbose
|
||||||
Write-Verbose "Setting up output directories" -Verbose
|
Write-Verbose "Setting up output directories" -Verbose
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -189,33 +186,6 @@ if ($Copy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set version environment variable for WiX
|
|
||||||
$env:VERSION = $Version
|
|
||||||
|
|
||||||
Write-Verbose "Creating MSI package" -Verbose
|
|
||||||
|
|
||||||
try {
|
|
||||||
# Define MSI package paths
|
|
||||||
$msiFileName = "install-$Architecture.msi"
|
|
||||||
$msiPackagePath = "$PWD/out/$msiFileName" -replace '\\', '/'
|
|
||||||
|
|
||||||
Write-Verbose "Building MSI: $msiPackagePath" -Verbose
|
|
||||||
wix build -acceptEula wix7 -arch $Architecture -out $msiPackagePath .\oh-my-posh.wxs
|
|
||||||
|
|
||||||
if (-not (Test-Path $msiPackagePath)) {
|
|
||||||
throw "MSI package was not created successfully"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Write-Error "Failed to create MSI package: ${_}"
|
|
||||||
throw
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($Sign) {
|
|
||||||
$signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion
|
|
||||||
Invoke-PackageSigning -PackagePath $msiPackagePath -SigningTools $signingTools
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Verbose "Creating MSIX package" -Verbose
|
Write-Verbose "Creating MSIX package" -Verbose
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -223,7 +193,7 @@ try {
|
|||||||
$currentPath = $PWD -replace '\\', '/'
|
$currentPath = $PWD -replace '\\', '/'
|
||||||
$manifestPath = "$currentPath/appxmanifest.xml"
|
$manifestPath = "$currentPath/appxmanifest.xml"
|
||||||
$mappingFilePath = "$currentPath/mapping.txt"
|
$mappingFilePath = "$currentPath/mapping.txt"
|
||||||
$msixPackagePath = "$currentPath/out/$($msiFileName)x"
|
$msixPackagePath = "$currentPath/out/install-$Architecture.msix"
|
||||||
$makeappxPath = "C:/Program Files (x86)/Windows Kits/10/bin/$SDKVersion/x64/makeappx.exe"
|
$makeappxPath = "C:/Program Files (x86)/Windows Kits/10/bin/$SDKVersion/x64/makeappx.exe"
|
||||||
|
|
||||||
# Validate required files exist
|
# Validate required files exist
|
||||||
@@ -257,12 +227,10 @@ catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($Sign) {
|
if ($Sign) {
|
||||||
if ($null -eq $signingTools) {
|
|
||||||
$signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion
|
$signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion
|
||||||
}
|
|
||||||
Invoke-PackageSigning -PackagePath $msixPackagePath -SigningTools $signingTools
|
Invoke-PackageSigning -PackagePath $msixPackagePath -SigningTools $signingTools
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Verbose "Successfully completed building MSI and MSIX packages" -Verbose
|
Write-Verbose "Successfully completed building the MSIX package" -Verbose
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
@@ -2,10 +2,8 @@ package upgrade
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/log"
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/runtime/http"
|
"github.com/jandedobbeleer/oh-my-posh/src/runtime/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,12 +23,6 @@ To enable automated upgrades, run: 'oh-my-posh enable upgrade'.
|
|||||||
//
|
//
|
||||||
// The upgrade check is only performed every other week.
|
// The upgrade check is only performed every other week.
|
||||||
func (cfg *Config) Notice() (string, bool) {
|
func (cfg *Config) Notice() (string, bool) {
|
||||||
// never validate when we install using the Windows Store
|
|
||||||
if os.Getenv("POSH_INSTALLER") == "ws" {
|
|
||||||
log.Debug("skipping upgrade check because we are using the Windows Store")
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
|
|
||||||
if !http.IsConnected() {
|
if !http.IsConnected() {
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
||||||
@@ -56,25 +55,17 @@ func TestCanUpgrade(t *testing.T) {
|
|||||||
cases := []struct {
|
cases := []struct {
|
||||||
Case string
|
Case string
|
||||||
CurrentVersion string
|
CurrentVersion string
|
||||||
Installer string
|
|
||||||
Expected bool
|
Expected bool
|
||||||
}{
|
}{
|
||||||
{Case: "Up to date", CurrentVersion: latest},
|
{Case: "Up to date", CurrentVersion: latest},
|
||||||
{Case: "Outdated Linux", Expected: true, CurrentVersion: "3.0.0"},
|
{Case: "Outdated Linux", Expected: true, CurrentVersion: "3.0.0"},
|
||||||
{Case: "Outdated Darwin", Expected: true, CurrentVersion: "3.0.0"},
|
{Case: "Outdated Darwin", Expected: true, CurrentVersion: "3.0.0"},
|
||||||
{Case: "Windows Store", Installer: "ws"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
build.Version = tc.CurrentVersion
|
build.Version = tc.CurrentVersion
|
||||||
|
|
||||||
if len(tc.Installer) > 0 {
|
|
||||||
os.Setenv("POSH_INSTALLER", tc.Installer)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, canUpgrade := ugc.Notice()
|
_, canUpgrade := ugc.Notice()
|
||||||
assert.Equal(t, tc.Expected, canUpgrade, tc.Case)
|
assert.Equal(t, tc.Expected, canUpgrade, tc.Case)
|
||||||
|
|
||||||
os.Setenv("POSH_INSTALLER", "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user