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] checkver.ps1 wrongly shows URL not valid when disconnected #5891

Open
goyalyashpal opened this issue Apr 13, 2024 · 1 comment
Open
Labels

Comments

@goyalyashpal
Copy link

goyalyashpal commented Apr 13, 2024

Bug Report

Current Behavior

when the system is not connected to internet, the scoop/bin/checkver.ps1 says URL ... is not valid

Expected Behavior

it should have said disconnected, or not connected, or unable to connect or the like.
but never "URL invalid" in such case

Additional context/output

$ declare spf="/d/userfiles/scoop/apps/scoop/current/bin"

$ # Disconnected state
$ ls *.json | sed 's/.json$//' | xargs -i powershell -c $spf/checkver.ps1 {} .
beeref: The remote name could not be resolved: 'api.github.com'
URL https://api.github.com/repos/rbreu/beeref/releases/latest is not valid
doublecmd-devrelease: The remote name could not be resolved: 'api.github.com'
URL https://api.github.com/repos/doublecmd/doublecmd/releases/latest is not valid
doublecmd-snapshot: The remote name could not be resolved: 'doublecmd.sourceforge.io'
URL https://doublecmd.sourceforge.io/snapshots/rss.php?os=win is not valid

$ # Connected
$ ls *.json | sed 's/.json$//' | xargs -i powershell -c $spf/checkver.ps1 {} .
beeref: 0.3.2
doublecmd-devrelease: 1.1.12
doublecmd-snapshot: 1.2.0.r11292 (scoop version is 1.2.0.r11286) autoupdate available

Possible Solution

shared in first comment below to keep it separate

System details

$ systeminfo | grep -iE "^os version|system type"
OS Version:                10.0.19045 N/A Build 19045
System Type:               x64-based PC

$ powershell -c '& {$PSVersionTable.PSVersion}'

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  4170

$ cat "$USERPROFILE"/.config/scoop/config.json
{
    "root_path":  "D:\\UserFiles\\scoop",
    "global_path":  "D:\\ProgramFiles\\scoop_global",
    "last_update":  "2024-04-13T08:17:11.8296437......",
    "alias":  {
                  "cat-dum":  "scoop-cat-dum"
              },
    "debug":  true,
    "scoop_branch":  "master",
    "scoop_repo":  "https://github.com/ScoopInstaller/Scoop"
}

$ scoop -V | head -n2
Current Scoop version:
v0.3.1 - Released at 2022-11-15
@goyalyashpal
Copy link
Author

Possible Solution

i understand that the condition / trigger for showing invalid url might very well be valid, or a more aware check might be hard to implement.

so, a check should be made before actually using the url to ensure if connected to internet. if not, then it should gracefully exit right there and skip using / commenting on url altogether.

but the problem with this can be that it won't work with local urls/full filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant