Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scoop version #48

Open
JanHuege opened this issue Sep 3, 2024 · 4 comments
Open

Fix scoop version #48

JanHuege opened this issue Sep 3, 2024 · 4 comments
Labels
scoop relates to the scoop package manager for Windows

Comments

@JanHuege
Copy link

JanHuege commented Sep 3, 2024

Installing via scoop on windows 11:

use and current do not have any effect. Downloading jdks works but is useless without the version manager functionality.

@patrick-mccourt
Copy link

Hi Jan,

Thanks for your patience while I've looked into this, the issue seems to be down to how scoop installs jabba. Scoop grabs the binary from the github releases and places it in the relevant directory.

This misses one step from our install script which activates the shell integration.

I have had an issue raised to look at the install process and making it a little better and haven't had the time. Package managers like scoop won't want a scripted install in so I need to come up with another way of setting up jabba to ensure the install works.

In the mean time, I can suggest you could do 1 of 2 things:

  1. Uninstall the scoop version and use the powershell script in this repo

or 2: Keep your scoop install and do this step manually:

Create a jabba.ps1 file in :

C:\Users\patri\scoop\apps\jabba\current\ with the contents:

$env:JABBA_HOME="C:\Users\$YOUR_USERNAME\scoop\apps\jabba\current"

function jabba
{
    $fd3=$([System.IO.Path]::GetTempFileName())
    $command="& 'C:\Users\$YOUR_USERNAME\scoop\apps\jabba\current\bin\jabba.exe' $args --fd3 `"$fd3`""
    & { $env:JABBA_SHELL_INTEGRATION="ON"; Invoke-Expression $command }
    $fd3content=$(Get-Content $fd3)
    if ($fd3content) {
        $expression=$fd3content.replace("export ","`$env:").replace("unset ","Remove-Item env:") -join "`n"
        if (-not $expression -eq "") { Invoke-Expression $expression }
    }
    Remove-Item -Force $fd3
}

Add in to your powershell profile:

if (Test-Path "C:\Users\$YOUR_USERNAME\scoop\apps\jabba\current\jabba.ps1") { . "C:\Users\$YOUR_USERNAME\scoop\apps\jabba\current\jabba.ps1" }

That should get you most of the jabba functionality (minus the default issue in your other issue)

@patrick-mccourt patrick-mccourt added the scoop relates to the scoop package manager for Windows label Sep 21, 2024
@Baneeishaque
Copy link

i come with this solution - https://github.com/Baneeishaque/Scoop-Apps/blob/master/bucket/jabba.json.
i don't know it is the best approach. i am open for suggestions.

@JanecekPetr
Copy link

Package managers like scoop won't want a scripted install in

I don't think so, Scoop has post-install scripts pretty often. I think it's fair to just open a ticket in Scoop's main bucket, explain what you're doing, and provide a PR.

@diefesson
Copy link

Have you considered distributing jabba in a .zip file containing any additional required files besides the executable and/or implementing a jabba shell <shell> command that outputs the snippet that needs to be added to the shell profile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scoop relates to the scoop package manager for Windows
Projects
None yet
Development

No branches or pull requests

5 participants