feat(scoop): remove option due to not correctly supporting MSI

This commit is contained in:
Jan De Dobbeleer 2024-11-26 18:47:12 +01:00 committed by Jan De Dobbeleer
parent 5ba9ffb069
commit e139f5eadd
9 changed files with 9 additions and 144 deletions

View file

@ -5,9 +5,6 @@ on:
version:
description: 'The latest version'
required: true
release:
description: 'The release id'
required: false
jobs:
microsoft_store:

View file

@ -58,7 +58,7 @@ jobs:
needs: package
strategy:
matrix:
workflow: [winget, microsoft_store, scoop]
workflow: [winget, microsoft_store]
steps:
- name: Notify 🙋🏾‍♀️
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
@ -70,5 +70,5 @@ jobs:
repo: '${{ github.event.repository.name }}',
workflow_id: '${{ matrix.workflow }}.yml',
ref: 'main',
inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', ''), "release": "${{ github.event.release.id }}" }
inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')}
})

View file

@ -1,42 +0,0 @@
name: Scoop
on:
workflow_dispatch:
inputs:
version:
description: 'The latest version'
required: true
release:
description: 'The release id'
required: true
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: ${{ github.workspace }}/packages/scoop
steps:
- name: Checkout code 👋
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Update Template ✍️
run: |
./build.ps1 -Version ${{ github.event.inputs.version }}
- name: Upload artifacts 🆙
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
await github.rest.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.inputs.release }},
name: 'oh-my-posh.json',
data: await fs.readFile('./packages/scoop/dist/oh-my-posh.json')
});

View file

@ -5,9 +5,6 @@ on:
version:
description: 'The latest version'
required: true
release:
description: 'The release id'
required: false
jobs:
publish:

View file

@ -1,30 +0,0 @@
Param
(
[parameter(Mandatory = $true)]
[string]
$Version
)
function Get-HashForArchitecture {
param (
[parameter(Mandatory = $true)]
[string]
$Architecture,
[parameter(Mandatory = $true)]
[string]
$Version
)
$hash = (new-object Net.WebClient).DownloadString("https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$Version/install-$Architecture.msi.sha256")
return $hash.Trim()
}
New-Item -Path "." -Name "dist" -ItemType "directory"
$HashAmd64 = Get-HashForArchitecture -Architecture 'x64' -Version $Version
$Hash386 = Get-HashForArchitecture -Architecture 'x86' -Version $Version
$content = Get-Content '.\oh-my-posh.json' -Raw
$content = $content.Replace('<VERSION>', $Version)
$content = $content.Replace('<HASH-AMD64>', $HashAmd64)
$content = $content.Replace('<HASH-386>', $Hash386)
$content | Out-File -Encoding 'UTF8' './dist/oh-my-posh.json'

View file

@ -1,29 +0,0 @@
{
"version": "<VERSION>",
"description": "A prompt theme engine for any shell",
"homepage": "https://ohmyposh.dev",
"license": {
"identifier": "MIT",
"url": "https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/COPYING"
},
"architecture": {
"64bit": {
"url": "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v<VERSION>/install-x64.msi",
"hash": "<HASH-AMD64>"
},
"32bit": {
"url": "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v<VERSION>/install-x86.msi",
"hash": "<HASH-386>"
}
},
"installer": {
"args": [
"/quiet",
"INSTALLER=scoop"
]
},
"post_install": [
"Write-Host 'Thanks for installing Oh My Posh.'",
"Write-Host 'Have a look at https://ohmyposh.dev for detailed instructions for your shell.'"
]
}

View file

@ -359,27 +359,20 @@ func (term *Terminal) Shell() string {
if len(term.CmdFlags.Shell) != 0 {
return term.CmdFlags.Shell
}
log.Debug("no shell name provided in flags, trying to detect it")
pid := os.Getppid()
p, _ := process.NewProcess(int32(pid))
name, err := p.Name()
if err != nil {
log.Error(err)
return UNKNOWN
}
log.Debug("process name: " + name)
// this is used for when scoop creates a shim, see
// https://github.com/jandedobbeleer/oh-my-posh/issues/2806
executable, _ := os.Executable()
if name == executable {
p, _ = p.Parent()
name, err = p.Name()
log.Debug("parent process name: " + name)
}
if err != nil {
log.Error(err)
return UNKNOWN
}
// Cache the shell value to speed things up.
term.CmdFlags.Shell = strings.Trim(strings.TrimSuffix(name, ".exe"), " ")
return term.CmdFlags.Shell

View file

@ -22,7 +22,7 @@ When using oh-my-posh inside the WSL, make sure to follow the [Linux][linux] ins
:::
<a href="https://apps.microsoft.com/detail/xp8k0hkjfrxgck?mode=mini" target="_blank">
<ThemedImage
<ThemedImage
alt="msstore"
width="232"
height="68"
@ -40,7 +40,6 @@ When using oh-my-posh inside the WSL, make sure to follow the [Linux][linux] ins
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
{ label: 'chocolatey', value: 'chocolatey'},
]
@ -53,15 +52,6 @@ Open a PowerShell prompt and run the following command:
winget install JanDeDobbeleer.OhMyPosh -s winget
```
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
```powershell
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
```
</TabItem>
<TabItem value="manual">
@ -123,7 +113,6 @@ Exclusions should be added with the full path to the executable, you can get it
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
{ label: 'chocolatey', value: 'chocolatey'},
]
@ -136,15 +125,6 @@ Open a PowerShell prompt and run the following command:
winget upgrade JanDeDobbeleer.OhMyPosh -s winget
```
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
```powershell
scoop update oh-my-posh
```
</TabItem>
<TabItem value="manual">
@ -179,7 +159,6 @@ for the prompt initialization in PowerShell.
[fonts]: /docs/installation/fonts
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
[linux]: /docs/installation/linux
[themes]: /docs/themes

View file

@ -73,7 +73,7 @@ oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" |
Replace `jandedobbeleer.omp.json` with the theme you use.
:::caution
Only winget and scoop add the environment variable `POSH_THEMES_PATH` automatically. For Homebrew, use
Only winget and the Windows Store add the environment variable `POSH_THEMES_PATH` automatically. For Homebrew, use
`$(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json`.
:::