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

[Bug]: Only set GRADLE_USER_HOME environment variable if not already set #4512

Closed
3 tasks done
f-cramer opened this issue Mar 5, 2023 · 1 comment · Fixed by #4530
Closed
3 tasks done

[Bug]: Only set GRADLE_USER_HOME environment variable if not already set #4512

f-cramer opened this issue Mar 5, 2023 · 1 comment · Fixed by #4530
Labels
bug Something isn't working

Comments

@f-cramer
Copy link
Contributor

f-cramer commented Mar 5, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

gradle / gradle-bin

Expected/Current Behaviour

When installing gradle or gradle-bin scoop overwrites the environment variable GRADLE_USER_HOME even if it had been set to another location before. This means that every time I update gradle using scoop, I have to remember to reset the variable to the value that is expected by my dev environment.

Steps to Reproduce

scoop install gradle

Possible Solution

Do not set the variable if it is already set to another value

Scoop and Buckets Version

scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
75705b407 (HEAD -> master, origin/master, origin/HEAD) twitchdownloader: Update to version 1.52.0

'java' bucket:
4cd702bd (HEAD -> master, origin/master, origin/HEAD) temurin8-nightly-jre: Update to version 8.0.372-4.0.202303031825

'main' bucket:
50795b1a9 (HEAD -> master, origin/master, origin/HEAD) marksman: Update to version 2023-03-04

'nerd-fonts' bucket:
ac12209 (HEAD -> master, origin/master, origin/HEAD) SarasaGothic: Update to version 0.40.2

'nirsoft' bucket:
28db834 (HEAD -> master, origin/master, origin/HEAD) Excluded two pad files that require a password. They need to be updated manually.

'nonportable' bucket:
43965c9 (HEAD -> master, origin/master, origin/HEAD) encodegui-np: Update to version 1.1.5

Scoop Config

scoop config


last_update  : 2023-03-05T01:33:45.0008283+01:00
alias        : @{us=scoop-us}
--global     : credential.helper
scoop_branch : master
scoop_repo   : https://github.com/ScoopInstaller/Scoop

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.963
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.963
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

@f-cramer f-cramer added the bug Something isn't working label Mar 5, 2023
@rashil2000
Copy link
Member

Please make a PR!

In the post_install script, you can check for the existence of the variable, and if it isn't set, set it using

env GRADLE_USER_HOME $global "$dir\\.gradle"
Set-Content env:\GRADLE_USER_HOME "$dir\\.gradle"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants